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

How to use play() and pause() ?


Hi,

I want to ask on how to use the play() and pause() from javascript API when I have embedded my video like this in our page
<script type="text/javascript" src="http://content.jwplatform.com/players/ChlPM4VW-FvoGVhLV.js"></script> ?

Thanks,

1 Community Answers

Randy

JW Player Support Agent  
0 rated :

Hello,

It seems you are currently using the single line embed for our player setup. You can potentially use the API in conjunction with the single line embed but you may consider using the lib for the player and potentially building code around that in the setup block. This is just a suggestion.

.play(state)
Toggles playback of the player. If the state is set true the player will start playing, if set false the player will pause and if omitted, the player will toggle playback.
.pause(state)
Toggles playback of the player. If the state is set true the player will pause, if set false the player will start playing and if omitted, the player will toggle playback.

You can find our full API here: https://support.jwplayer.com/customer/portal/articles/1413089-javascript-api-reference#playback

Randy

This question has received the maximum number of answers.