views:

987

answers:

1

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.

A: 

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