Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

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

9 Community Answers

JW Player

User  
0 rated :

Thanks! This will be very useful!

jg

JW Player

User  
0 rated :

What method do you suggest for monitoring the status?

JW Player

User  
0 rated :

@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)

JW Player

User  
0 rated :

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!

JW Player

User  
0 rated :

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.

JW Player

User  
0 rated :

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*

JW Player

User  
0 rated :

I did so yesterday. Everything works. Thanks

JW Player

User  
0 rated :

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';
}
}
};

JW Player

User  
0 rated :

<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?

This question has received the maximum number of answers.