Question

I don't understanding what code is needed to simply output any interaction with the Flash JW Player. Below is a code demo from their documentation (results in addControllerListener being undefined). Some more details in the JW Player Flash API.

function muteTracker(obj) { alert('the new mute state is: '+obj.state); };
player.addControllerListener("MUTE","muteTracker");

I want to extend this to include functions to track all other interactions such as play, seek, fullscreen etc.

Was it helpful?

Solution

You were on the right track! If you check out the player API, you'll notice that there are three methods for adding listeners:

  • player.addControllerListener(EVENT,myFunction);
  • player.addModelListener(EVENT,myFunction);
  • player.addViewListener(EVENT,myFunction);

Pair that with the events list (http://developer.longtailvideo.com/trac/wiki/Player4Events) and you're good to go. Thus, if you're looking to listen for seek events, it would look something like:

player.addViewListener(ViewEvent.PLAY,myFunction);

or for seek,

player.addViewListener(ViewEvent.SEEK,myFunction);

Best,

Zach

Developer, LongTail Video

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top