Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

callback help please

5 replies [Last post]

I successfully embed the player and have test the call back url. However, the player just never call the url at all. Can anybody see what's wrong with the setup? any help is greatly appreciated.!!!

<html>

<head>

<title>Simple JW Player</title>

<script type="text/javascript" src="swfobject.js"></script>

<script type='text/javascript'>
function createPlayer()
{
var s1 = new SWFObject('http://localhost/osc/mediaplayer/mediaplayer.swf', 'playlist', '475', '450', '9');
s1.addParam('allowfullscreen', 'true');
s1.addParam('allowscriptaccess','always');
s1.addVariable('author', 'jijikkoo');
s1.addVariable('id', 'Movie');
s1.addVariable('width', '475');
s1.addVariable('height', '450');
s1.addVariable('displayheight', '350');
s1.addVariable('file', 'rtmp://127.0.0.1/oflaDemo&id=ironman');
s1.addVariable('overstretch', 'true');
s1.addVariable('showdigits', 'true');
s1.addVariable('autostart', 'false');
s1.addVariable('shuffle', 'false');
s1.addVariable('repeat', 'list');
s1.addVariable('showicons', 'true');
s1.addVariable('thumbsinplaylist', 'true');
s1.addVariable('logo', 'http://my.domain.com/logo.png');
s1.addVariable('backcolor', '0xFFFFFF');
s1.addVariable('frontcolor', '0x404040');
s1.addVariable('lightcolor', '0x0FFFF0');
s1.addVariable('callback', 'http://localhost/osc/statistics_CSV.php');
s1.write('player');
};
</script>

</head>

<body onload="javascript:createPlayer();">

<div id="player">
<a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Plugin</a>
to see this gallery.
</div>
</body>

</html>

You may not be able to make a local callback. There are various Flash and JavaScript Security Restrictions that prohibit access to local files so that someone cannot access your local files from the Internet. I'm not sure if they apply here but if this doesn't work, that is a probable cause. Your code looks OK.

Have you tried calling the script from your browser to make sure that it is working? Something like: http://localhost/osc/statistics_CSV.php?state=start&file=video.flv&id=123&title=This VideoIf that works, then I would suspect the Security Restrictins are stopping the callback.

The other thing you could do, would be to put the mediaplayer and callback script on line, at a different domain, and see if it works then.

Yes, yes yes. It works, thank you so much for your help. Otherwise, I 'll chasing my tail again.

regards,

The next time you are chasing your tail, make sure that you capture it on video and post it to YouTube. We can all use a good laugh.

Good Luck!

Ah ha...so the callback expects a URL not a javascript function...that kind of sucks, but I can work with it. Thanks for posting this, otherwise I'd be recoding to try and get an actual callback function to work.

@Ohhh,

If you want to do it in JS, see this post where everything is done in JS http://www.jeroenwijering.com/?thread=6080#msg53559 Statistics Plus