JW Player 6 search and pause

How can I get JW Player 6 to search for a point and stop there, without losing the ability to search, continuing to play on subsequent requests.

For example, the following solution is not satisfactory because it pauses the player after each search request, not just the current one.

var player = jwplayer('target').setup({ file: '/some-file.mp3' }); player.onSeek(function(){ player.pause(); }); player.seek(300); 

Indeed, I am looking for an API that is as simple as this:

 player.seek(toTime, pause = false) 

Please note that there is a similar open-ended question regarding JW Player 5.4 .

+8
javascript html5 flash video jwplayer
source share
1 answer

This can be done using the attributes of HTML tags. Example


var mediaElement = document.getElementById ('audio');

mediaElement.seekable.start (); // Returns the start time (in seconds)
mediaElement.seekable.end (); // Returns the end time (in seconds)
mediaElement.currentTime = 122; // Search for up to 122 seconds
mediaElement.played.end (); // Returns the number of seconds the browser played.

0
source share

All Articles