JWPlayer: problem with stopping and playing with javascript

I am using jwplayer to play videos on my site. I want to implement this scenario:

  • A small image of a finger nail represents a video.
  • when the user clicks on the thumb image, the jvplayer div shows and starts playing, and the thumb image is hidden.
  • An external close button allows you to close the video. Then the thumb image will appear again.

I am trying to accomplish this using js. To play the video, use the following:

jwplayer('container').play(); 

and this is used to stop jwplayer:

  jwplayer('container').stop(); 

Functions work in chrome. But in firefox , when I try to play the video a second time, jwplayer is in the BUFFERING state. Also go back to the placeholder image.

console error is also displayed

Error: Permission denied to access the 'toString' property

This is a jsfiddle demo example

http://jsfiddle.net/35bGW/

Please help me find a solution for this.

thanks

+6
source share
1 answer

Now YouTube by default uses HTML5 mode as primary in 6.9.

There are some problems setting up the player from YouTube in HTML5 mode.

I reported this as a problem for the team of players here.

Currently running in your code, in this line:

 stretching: 'exactfit', 

Add

 primary: 'flash', 

This should solve the problem for now.

+3
source

Source: https://habr.com/ru/post/972318/


All Articles