6

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

Vysakh V K
  • 232
  • 1
  • 3
  • 13
  • _"Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and **the shortest code necessary to reproduce it in the question itself.**"_ – Cerbrus Jul 16 '14 at 12:14
  • try to add primary:'flash' to jwplayer setup – Ben Jul 16 '14 at 13:26

1 Answers1

3

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.

emaxsaun
  • 4,191
  • 2
  • 13
  • 13
  • Now it showing an Error: Ad adLoadError error: No ads were found in the ad response. At least one ad is required to be able to load or play. errorCode: 1001 in console – Vysakh V K Jul 17 '14 at 04:52
  • Also the mouse becomes hidden when hove over to the right of the player – Vysakh V K Jul 17 '14 at 05:06
  • That error message means that your ad tag is not serving any ads. It is unrelated to the Youtube issues you were having. – emaxsaun Jul 17 '14 at 15:02
  • Finally I got a temporary solution for this problem. It seems to occur when my embed is initially hidden. So I have managed it with changing z-index of the embed container. – Vysakh V K Aug 01 '14 at 06:30
  • Ah, ok, got it, glad you got it. – emaxsaun Aug 01 '14 at 16:21