JWPlayer : issue in stop and play using javascript
Asked Answered
C

1

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

Carminecarmita answered 16/7, 2014 at 12:12 Comment(2)
"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."Chromatology
try to add primary:'flash' to jwplayer setupDisrepute
C
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.

Camelback answered 16/7, 2014 at 14:55 Comment(5)
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 consoleCarminecarmita
Also the mouse becomes hidden when hove over to the right of the playerCarminecarmita
That error message means that your ad tag is not serving any ads. It is unrelated to the Youtube issues you were having.Camelback
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.Carminecarmita
Ah, ok, got it, glad you got it.Camelback

© 2022 - 2024 — McMap. All rights reserved.