Question

When a user triggers a Javascript action, I want the JW FLV to seek back 5 seconds from the current location. I know how to send events using player.sendEvent('SEEK',seconds). But I dont know how many seconds to pass as JS does not know the current location. Can someone please help? http://developer.longtailvideo.com/trac/wiki/FlashEvents#Viewevents.

No correct solution

OTHER TIPS

1)You can get the current location as :

getPosition(): Returns the current playback position in seconds, as a number.

2)And then seek to required position as:

seek(position):Jump to the specified position within the currently playing item. Parameters: position:Number: Requested position in seconds.

Also refer this

Actually you can get the current location with javascript. Here's how:

player.addModelListener('TIME', 'timeMonitor');
var time = null;
function timeMonitor(obj) {
  time = obj.position;
}

The time variable constantly updates, so then just do something like:

function userTriggeredJsAction(){
   var newTime = time - 5;
   player.sendEvent('SEEK',newTime);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top