oblivion19
oblivion19

Reputation: 308

JWplayer seek to live

I would like to seek to 'live' during a live stream. I tried adding a jwplayer().seek(1000), thinking that because it's a large number, it will go to 'live', but the behaviour I get is a black screen.

I am using Jwplayer 7.2.2

Any suggestions?

Thanks.

Upvotes: 1

Views: 1214

Answers (2)

jherrieven
jherrieven

Reputation: 425

Ordinarily a standard Live Stream will already be at the 'livest' point available. The control bar will display 'Live Broadcast', there will be no scrub bar and the jwplayer().getDuration() method will return Infinity.

If however you are using a DVR Live Stream, this allows your viewers to pause, play, and rewind the stream. The scrub bar is added to the control bar in order to enable this. With a DVR stream the jwplayer().getDuration() will a negative value.

To seek to the end of a DVR Live stream you should be able to do the following:

jwplayer().seek(-jwplayer().getDuration())

Upvotes: 1

simsketch
simsketch

Reputation: 3042

When calling the JW Player API, don't forget to specify the id of the element inside the (''), otherwise your browser doesn't know which element to act on.

Furthermore, you can't scrub a stream. You can only scrub a progressive download. If you have a time position to jump to, you can do that in JW Player, like this:

<div id="playerDiv"></div>

jwplayer('playerDiv').seek('10');

to jump 10 seconds into your progressively downloading video.

Upvotes: 0

Related Questions