Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

HTML5 version won't pause after seek


Using a custom playlist I have been trying to avoid poster images and have the video pause on the first farme, which then acts as a poster image.
This works fine in the Flash version using this code inj the function that starts a new video:

playerInstance.seek(0);
playerInstance.play();
playerInstance.pause();

The HTML version, however, will not pause, but proceeds to play the video (a bug?).

I can make both versions work using this code:

var seek = 0;
playerInstance.onPlay(function() {
if(seek==1){
playerInstance.play(false);
seek=0;
}
});

and in the function that starts the new video:

playerInstance.seek(0);
seek = 1;

If I include a .play and .pause in the function it will still work in HTML5, where you can start the video with one click, but in the Flash version you now have to make 3 clicks to start the video.

Is there a different way to pause on the first frame that works for both HTML5 and Flash? Alternatively, it would be nice to get the bug fixed that prevents the HTML5 version from pausing after a seek.

9 Community Answers

Randy

JW Player Support Agent  
0 rated :

Hello,

Do you have a sample page with this implementation in place?

Randy

carlf66

User  
1 rated :

A sample showing the problem can be found at:

http://www.1966dk.com/andalucia2015-7c1.html

A page that works in HTML5 as well as Flash is at:

http://www.1966dk.com/andalucia2015.html

Carl

Randy

JW Player Support Agent  
1 rated :

Hello,

At this time this is not something we support of of box but you may potentially be able to achieve this with API as you’ve tried above. I am not sure why it might work in one provider over the other but in general testing it did not work on my end. It could perhaps be a timing issue of some sort. If you have not already done so, please take a look at our API as it has some useful detail: http://support.jwplayer.com/customer/portal/articles/1413089-javascript-api-reference .

Randy

carlf66

User  
1 rated :

Hi Randy,

I have tried a variety of methods including
playerInstance.on('seeked',function() {...});
and
playerInstance.on('firstFrame',function() {...});
What greatly complicates the situation is that the result varies between platforms and browsers. And I don't have access to all varieties. The working link quoted above has been tested in IE, Firefox and Chrome on Win XP, Win7, and Win8.1 as well as in the stock browser, the Puffin Browser, and Chrome on Android. It works perfectly for me in all except the Android stock browser and Puffin Browser. Did that version not work for you? If not, please let me know which OS and browser you were using.

As it turns out, it is not necessary to use the seek(0) function. I can just pause the play action with
playerInstance.on('play',function() {...});
immediately after a new clip has started to play. That will pause it pretty close to the first frame.
A working example can be seen at http://www.1966dk.com/florida2014-7d2.html. Does this work for you?

Thanks,
Carl

PS: These problems raise the question as to which platforms and browsers the Javascript API has been tested on. It would also be good to know if there are known problems with certain platform/browser combinations.

Randy

JW Player Support Agent  
0 rated :

Hello Carl,

We do have a listing of the current browsers we’ve tested our JW Player implementation on here: http://support.jwplayer.com/customer/portal/articles/1403653-browser-device-reference . I believe we understand your situation as there are so many flavors or browsers and OSs out now that it makes it hard to validate compatibility. We try our best to cover the more common iterations and vet those out. I have tried this on FireFox/Chrome and Safari with no joy. I will try the implementation within our Windows QA next.

Randy

carlf66

User  
1 rated :

Hi Randy,

Since you mention Safari I am assuming you are on a Mac. I don't have access to Macs or iOS devices. Windows is still by far the most used OS.

The page at http://www.1966dk.com/florida2014-7d2.html contains a playlist of only 2 videos and the first one loads "normally" with a poster image. So what you need to test is whether the second video stops on the first frame when the first video completes. When you click on the 2nd video it will immediately start playing.

I have now updated my scripts so that different versions of the script will be loaded depending on whether you are on a mobile device or not. This is necessary beacuse mobile devices generally will not autostart (some browsers will, others won't). In the desktop version all videos in the playlist now stop on the first frame, whether on completion of a previous video or when clicking on the playlist. This way no poster images are needed at all. Works fine here under Windows.

Check out the new version at: http://www.1966dk.com/florida2014.html. I would be very interested to know if this works on Mac browsers.

Thanks.
Carl


Randy

JW Player Support Agent  
1 rated :

Hello,

The second iteration seems to work for me although the first did not. I’ll let our engineers know about this and see if we cannot submit this as a feature request.

Randy

carlf66 N/A

User  
0 rated :

Thanks, Randy. The ability to pause on the first frame would be a great addition to the player. Preparing the poster images is such a pain, and having a black screen at the start and/or the end of the video is also not very nice. If you could just upload the video and have it load and stop on the first frame, it would be ideal to lots of users.

I suggest this could be done as an extra value to the autostart parameter, eg like this:

autostart: firstframe,

I would like for the controlbar to be visible when the player pauses on the first frame. Another thing I don't like about the poster image is the fact that there is no controlbar, so when loaded it does not look like a video player.

A temporary fix that actually moves the controlbar under the video, has now been introduced in http://www.1966dk.com/florida2014.html (desktop version only).

Carl

carlf66 N/A

User  
0 rated :

Correction:

http://www.1966dk.com/florida2014.html has the hiding controlbar. The example with the permanent controlbar under the video is at http://www.1966dk.com/picos2012-9.html.

Carl

This question has received the maximum number of answers.