Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JWPlayer : issue in stop and play using javascript

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

  • A small thumb nail image represent the video.
  • when a user click on the thumb image the jwplayer div shows and starts to play and the thumb image will hide .
  • An external close button will allow to close the video. Then the thumb image will show again.

I am trying to accomplish it by using js. The following is used to play the video:

   jwplayer('container').play();

and this is used to stop the jwplayer:

   jwplayer('container').stop();

The functions are working in chrome . But in firefox when I try to play the video in second time the jwplayer is in BUFFERING state. Also revert back to the placeholder image.

also shows an error sometime in console

Error: Permission denied to access property 'toString'

This is a sample jsfiddle demo

http://jsfiddle.net/35bGW/

Please help me to find a solution for this.

Thanks

like image 490
Vysakh V K Avatar asked Jul 16 '14 12:07

Vysakh V K


People also ask

Why JW player is not working?

To fix JW player not working in Chrome, open settings after clicking on the three dot icon at the right, then choose Advanced. Fetch for Reset settings by scrolling down, It will ask for confirmation. Click on YES. Then restart your Chrome after this process gets complete.

How do I stop JW player?

The JW player doesn't show the browser menu. Right-click elsewhere on the page and choose the "Block an ad on this page" option. Then adjust the slider to the right until the JW player is no longer visible. Done!

How do I turn off autoplay on JW player?

As outlined in this Medium blog post, since most of the harder-to-block autoplay videos use Brightcove or JW Player, simply click the Privacy Badger icon and block anything detected with “jw” or “brightcove” in its name. That's regardless if it's seen by Privacy Badger as harmless (i.e. a green-colored setting) or not.


1 Answers

YouTube now defaults to HTML5 mode as primary in 6.9.

There are some issues with setting up the player again with YouTube in HTML5 mode.

I have reported this as an issue to the player team here.

A work around, for now, is in your code, under this line:

stretching: 'exactfit',

Add:

primary: 'flash',

This should work around the issue for the time being.

like image 152
emaxsaun Avatar answered Nov 13 '22 14:11

emaxsaun