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

JW 7 playe/pause options


hi
Are there any option to play and pause movie, when controls disabled?
thank you
Samuel
code:
var playerStreaming = jwplayer('StreamingVideo');
playerStreaming.setup({
file: 'local_movie.mp4',
image: 'https://www.google.co.il/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0CAcQjRxqFQoTCNfZjd_h_scCFeidcgod3J4GaQ&url=http%3A%2F%2Fwww.v-harness.com%2Fblog%2Fgolf-protest-by-man-living-in-a-tree-ends-abruptly-when-man-falls-out-of-tree%2F&psig=AFQjCNEu54kBAGh8J1dhLIKaNaeg24sY6A&ust=1442603172597613',
logo: {
file: "ext_img/favicon.png",
link: "-------------------------------------"
},
skin:"/skins/myskins.css",
autostart: true,
controls: false,
width: "100%",
ratio: "16:10",
aspectratio: "16:10",
stretching: "fill",
fullscreen: false,
responsive: true
}).on('play', function () {
statusCollection('play');
playerData();
}).on('pause', function () {
statusCollection('pause');
playerData();
}).on('complete', function () {
this.setControls(true);
statusCollection('complete');
});

5 Community Answers

Todd

JW Player Support Agent  
0 rated :

If you are disabling the controls, you would need to build your own HTML buttons that could then be used to play or pause the player. The play() and pause() events will toggle the state of the player if you do not pass a boolean value, so something here’s a basic example of what I mean:

<input type=button value=“Play / Pause” onClick=“jwplayer().play();”>

If you wanted two separate buttons, it would be something like:

<input type=button value=“Play” onClick=“jwplayer().play(true);”> <input type=button value=“Pause” onClick=“jwplayer().pause(true);”>

Please see http://support.jwplayer.com/customer/portal/articles/1413089-javascript-api-reference for more details on the API events.

Ler_Sam

User  
0 rated :

Hi

What I need is start the player without control button, with only play/pause option.

After first full watch, I need enable back and show control buttons (that I'm doing with cookie).

This scenario working great with YouTube movies, but doesn't work on streaming and local movies.

Thank you

Todd

JW Player Support Agent  
0 rated :

That code example should be working with all video types. Can you send me a link to a page where it is not?

My suggestion for the other stuff would be to do the following:

1) Disable the controls in the player
2) Use an external button that the user can press to play/pause, as I have already demonstrated
3) In our API’s onComplete() event, have a custom function that displays a Replay button, which is essentially calling jwplayer().seek(0) to start the video over

Ler_Sam

User  
0 rated :

Hi
Yes I understand option with adding external play/pause button.
I still try to stick to the option using build in options.

You can find three examples, in this page:
http://109.226.15.59/bootstrap/index.html

Thank you

Ler_Sam

User  
0 rated :

Hi

Found solution by using:
on('displayClick', function (){})

Thank you

This question has received the maximum number of answers.