Go
Not registered? Sign up!

How to send an event to a specific player please?

Google Translate
3 posts | return to the JavaScript Interaction forum | get the rss feed for this thread

Nov. 05, 2009TBD

Hey!
I will like to know how do I send an event to a specific player please?

I got 2 players on the same page.
(id: player1, player2)

Nov. 16, 2009Zachary Ozer

See http://www.longtailvideo.com/support/forum/JavaScript-Interaction/20276/How-to-separate-two-players-on-same-page

Nov. 17, 2009TBD

OK after trying so much with no clue of what I'm doing,
I got it!

<script type="text/javascript">
var player = null;
var playerz;

function stopPlayer(player)
{
playerz = player;
playerz.sendEvent('STOP');
};
</script>


and then call it like this:
<a href="#" onclick="stopPlayer(player1);">STOP PLAYER 1</a>
<br />
<a href="#" onclick="stopPlayer(player2);">STOP PLAYER 2</a>

Add a reaction

You can also return to the category or try this search for related threads.


 

Search the Forums

Go

Support

Support Here are some helpful links to learn more about the JW Player™:

Monetize Your Video

Monetize Your Video Earn money with ads from LongTail's AdSolution. Watch our demos and sign up now!

Why Buy a License?

Why Buy a License? If you don’t buy a commercial license, you cannot use a JW Player™ on (i) a site that has ads; (ii) a corporate site; or a (iii) CMS. Our licenses are very inexpensive, so what are you waiting for? Buy a license today.