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

Forums

/

Snippet player - stop at time limit

2 replies [Last post]

Hi Andersen,

I've been looking at your demo on your site:

http://home5.inet.tele.dk/nyboe/flash/mediaplayer/snippetplayer.htm

and am trying to work out why I cant seem to get this to work for me.

I have tried doing an exact copy of the code you used with local versions of the media player swf and playlist and even linking to the ones you use on your site in case you were using a different version of the media player to me but yet i can't get it to work like it does on this demo page. Is there something I am missing?

As far as i can tell all i should have to do is change the stop time var to my required length but yet it doesnt work at all.

var stopTime = 15;
var currentPosition;
var currentState;

function getUpdate(typ,pr1,pr2,pid) {
if(pid != "null") {
if(typ == "time") { currentPosition = pr1; }
else if(typ == "state") { currentState = pr1; }

if (currentPosition >= stopTime) {
if ((currentState == 2)||(currentState == 3)) {
sendEvent('stop'); 
setTimeout("sendEvent('next')",1000);
}

}

}
}

Any help would be greatly appreciated.

(i know its quite legacy in comparison to v4 etc but I really need to get this working on the player we already have implemented)

Many thanks

PS. I have used the entire javascript code you used on the demo and not just the part above. I am quite experienced with using version 3 of the media player and some of your more advanced demos from your site, but this one has stumpped me completely!

Andrew -

Recommend you use 4 player with the duration flashvar.