
on (Complete) events?
Is there any way to pass in an on (Complete) event function for this player?
I read the docs here: http://code.google.com/p/swfobject/wiki/SWFObject_2_0_documentation but didn't see any mention.
TIA!
jg
Is there any way to pass in an on (Complete) event function for this player?
I read the docs here: http://code.google.com/p/swfobject/wiki/SWFObject_2_0_documentation but didn't see any mention.
TIA!
jg
Thanks! This will be very useful!
jg
What method do you suggest for monitoring the status?
@Cylonraider,
What do you mean by *"status"* ?
State: (as shown above)
0 = paused/stopped (instantiated, ready to load/play media file)
1 = loading (buffering, if bufferlength > 0)
2 = playing
3 = completion (reached the end of the media file)
And how can I get the state from the .fla actionscript?
I'm making a few changes in the source.
What function whould I call to get the state? (i'll call it from _root).
Thanks!
Are there no suggestions of getting the current state (0,1,2 or 3) in the fla?
Want to display extra options when playing only.
Thanks in advance.
You're using v3.x player JavaScript API code.
See the v4.x player JS API code here: *http://www.longtailvideo.com/support/forum/JavaScript-Interaction/17072/Action-when-Video-Ends#msg115579*
I did so yesterday. Everything works. Thanks
Monitortheplayer'sstateifstate=3(completion)dosomething:bc.. functiongetUpdate(typ,pr1,pr2,pid)
{
if(typ=='state')
{
if(pr1==3)
{
// dropoutoffullscreen
this.window.focus();
// loadanewpage
window.location='http://www.google.com';
}
}
};
<script type="text/javascript" src="swfobject.js"></script>
<div id="player"></div>
<script type="text/javascript">
var so = new SWFObject('player.swf','mpl','470','20','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam('flashvars','&file=1.mp3&autostart=true');
so.write('player');
</script>
<script type="text/javascript">
function getUpdate(typ, pr1, pr2, pid)
{
if(typ == 'state')
{
if(pr1 == 3)
{
// drop out of fullscreen
this.window.focus();
// load a new page
window.location = 'http://www.google.com';
}
}
};
</script>
When the track plays to the end, nothing happens. Why?