Lucfia
Lucfia

Reputation: 671

Jwplayer - stop external video

I am using external video from Jwplayer.com. I would like to stop video after clicking on another div element. I didn't recieved any .js file or anything (i have only iframe code). Is it somehow possible?

Upvotes: 0

Views: 131

Answers (2)

Francesco
Francesco

Reputation: 1148

you can do:

<div id="player"></div>
<div id="stop_player" style="margin-top:10px;"> div stop player</div>

<script type="text/javascript">
var player = jwplayer("player");

player.setup({
  file: <media_path>,
});

$('#stop_player').on('click', function() {
  player.stop();
});
</script>

demo: http://codepen.io//pen/xEGapz

Upvotes: 1

HeidiWF
HeidiWF

Reputation: 157

If you register for a free account you can grab a self-hosted library from your dashboard: https://www.jwplayer.com/pricing/

Upvotes: 0

Related Questions