pupunzi / jquery.mb.YTPlayer

use a custom yutube player for a video as background on jQuery framework
https://pupunzi.com/mb.components/mb.YTPlayer/demo/demo.html
1.3k stars 431 forks source link

Does not work with latest version of Chrome (version 66) and Safari #357

Closed DenisDyack closed 6 years ago

DenisDyack commented 6 years ago

Hi There,

This plugin does not seem to work with the latest version of Chrome and Safari - it was working previously for several months until we updated our browsers. Everything loads properly but the video does not play. We looked into the code as best we could and we think it is the plugin.

You can check the site out here.

It seems work intermittently and if you go to the 404 page on the page and return via home button - then it will work. So depending on redirections, it may work. (We don't do much web work, so we are not sure).

It also does not seem to work with Safari.

It does work with FireFox and Edge. We tested this from several machines and different locations site over the globe.

I hope this helps!

DenisDyack commented 6 years ago

Also - here is an error we have gotten:

www-widgetapi.js:99 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ('https://www.apocalypse333.com'). h.B @ www-widgetapi.js:99

This does seem to be intermittent - it just went from failing 100% for me this morning to now working. Something really strange is going on.

DenisDyack commented 6 years ago

Ok - we have discovered the issue:

https://developers.google.com/web/updates/2017/09/autoplay-policy-changes

It seems with the new policies just rolled by Chrome and others out you have a high MEI to autoplay. The solution seems to be to mute sound to always pass. Muting the audio seems to fix the problem on all browsers.

Le-future commented 6 years ago

The solution provided by @DenisDyack is fine, except one point, how to play the video with the sound? I tried to fire it up muted, that works, then applied the .YTPUnmute(); in a setTimeout function, but immediately after that, the video stops 😞

pupunzi commented 6 years ago

The unmute action should be a real human click interaction like pressing a button or clicking on the BODY to make it works with the autoplay and the audio turned on. No way to simulate the event.

Le-future commented 6 years ago

What about to dedicate a button in the HTML for mute/unmute and simulate a click on it through JS?

pupunzi commented 6 years ago

The simulated event doesn't the trick it needs a physic action

Le-future commented 6 years ago

I just added a button in my HTML to unmute the video, but it seems that now, even these functions are no longer working:

jQuery.fn.YTPMute() jQuery.fn.YTPUnmute() jQuery.fn.YTPToggleVolume()

pupunzi commented 6 years ago

Hi, Those methods are working fine; check this demo: https://pupunzi.com/mb.components/mb.YTPlayer/demo/demo.html

hypersonic125 commented 6 years ago

Hello, With all respect, even in your demo, let's say at Change Video 2, if you press Pause in the middle of the movie the youtube controls appear, the movie title etc. It is not nice for a background. It is possible to solve this maybe with a fall-back photo when the movie stops?

pupunzi commented 6 years ago

@hypersonic125 Are you sure it doesn't depend on your Chrome browser extension? I just tested it on Chrome latest version (Version 67.0.3396.62) without any problem. here is a screencast:

https://pupunzi.com/downloads/ytp.mp4

hypersonic125 commented 6 years ago

Yes, I just updated the Chrome. Please be so kind and check yourself, it is not a secret, it is the home page of www.tornado.ro, The settings for the background video are autoplay, mute:true. It starts but if I press pause the ugly writing appears. I have some other movies in header pages or in smaller frames and it is the same. The player was provided with the Bootstrap, Titan template from Theme wagon. Do I have to replace the player that was provided with the template maybe with a newer version? The ugly part is that I work a lot for the design and everything was just perfect, I was very happy with player. In the last two weeks when I just launched the site presenting it to our resellers with big announcements and a lot of noise it started to show the youtube stuff :-( :-(

pupunzi commented 6 years ago

Hi, I think is some extension you've on your Chrome browser. It doesn't happen to me also on your site:

https://pupunzi.com/downloads/ytp-2.mp4