videojs / videojs-youtube

YouTube playback technology for Video.js
1.12k stars 548 forks source link

Youtube not working in Chrome #575

Open NazarLysyi opened 3 years ago

NazarLysyi commented 3 years ago

https://jsfiddle.net/L4mkxht5/ all time loader but video don't start https://i.imgur.com/Ytbt8BR.png

Chrome Version 87.0.4280.88 (Official Build) (64-bit)

update: trouble with vjs-poster and vjs-loading-spinner

NazarLysyi commented 3 years ago

bug only if using videojs styles and controls

gkatsev commented 3 years ago

Seems to be working for me, hm... It seems to stall, but I refreshed the page, and it's working just fine now.

NazarLysyi commented 3 years ago

image all time loader(

tatet commented 3 years ago

Hi, same here, we have some people with this issue. After some research may be related with first user event interaction, it seems Youtube iframe does not get this event and the play fails. I don't know if there is a relation but plyr.io player has the same behaviour too. Maybe some change in YT that affects all players?

samueleastdev commented 3 years ago

I have also got this problem videos are no longer working in chrome browser they work in other browsers.

code: 1005, message: "Error while trying to play the video"

Failed to load resource: the server responded with a status of 401 () base.js:8483 POST https://www.youtube.com/youtubei/v1/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8 401 (anonymous) @ base.js:8483 qm @ base.js:797 y_.fetch @ base.js:8481 (anonymous) @ base.js:3682 wa @ base.js:48 next @ base.js:49 (anonymous) @ base.js:272 Ue @ base.js:269 qra @ base.js:3681 AM @ base.js:3680 (anonymous) @ base.js:4908 wa @ base.js:48 next @ base.js:49 (anonymous) @ base.js:272 Ue @ base.js:269 Mza @ base.js:4908 (anonymous) @ base.js:4905 wa @ base.js:48 next @ base.js:49 f @ base.js:269 Promise.then (async) l @ base.js:271 f @ base.js:269 Promise.then (async) l @ base.js:271 (anonymous) @ base.js:272 Ue @ base.js:269 Gza @ base.js:4905 h @ base.js:4897 Kza @ base.js:4900 Qza @ base.js:4919 Vza @ base.js:4945 g.k.Ax @ base.js:8507 fT @ base.js:4944 h0 @ base.js:4956 L0 @ base.js:5089 g.k.playVideo @ base.js:8735 g.k.playVideo @ base.js:7528 a.F.<computed> @ base.js:3770 g.k.handleExternalCall @ base.js:7502 Y.a.B.<computed> @ base.js:3774 (anonymous) @ www-embed-player.js:793 p.Aa @ www-embed-player.js:855 p.ib @ www-embed-player.js:844 Yk.u @ www-embed-player.js:840 base.js:8483 POST https://www.youtube.com/youtubei/v1/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8 401 (anonymous) @ base.js:8483 qm @ base.js:797 y_.fetch @ base.js:8481 (anonymous) @ base.js:3682 wa @ base.js:48 next @ base.js:49 (anonymous) @ base.js:272 Ue @ base.js:269 qra @ base.js:3681 AM @ base.js:3680 (anonymous) @ base.js:4908 wa @ base.js:48 next @ base.js:49 (anonymous) @ base.js:272 Ue @ base.js:269 Mza @ base.js:4908 (anonymous) @ base.js:4905 wa @ base.js:48 next @ base.js:49 f @ base.js:269 Promise.then (async) l @ base.js:271 f @ base.js:269 Promise.then (async) l @ base.js:271 f @ base.js:269 Promise.then (async) l @ base.js:271 f @ base.js:269 Promise.then (async) l @ base.js:271 (anonymous) @ base.js:272 Ue @ base.js:269 Gza @ base.js:4905 h @ base.js:4897 Kza @ base.js:4900 Qza @ base.js:4919 Vza @ base.js:4945 g.k.Ax @ base.js:8507 fT @ base.js:4944 h0 @ base.js:4956 L0 @ base.js:5089 g.k.playVideo @ base.js:8735 g.k.playVideo @ base.js:7528 a.F.<computed> @ base.js:3770 g.k.handleExternalCall @ base.js:7502 Y.a.B.<computed> @ base.js:3774 (anonymous) @ www-embed-player.js:793 p.Aa @ www-embed-player.js:855 p.ib @ www-embed-player.js:844 Yk.u @ www-embed-player.js:840 base.js:8483 POST https://www.youtube.com/youtubei/v1/next?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8 401 (anonymous) @ base.js:8483 qm @ base.js:797 y_.fetch @ base.js:8481 (anonymous) @ base.js:3682 wa @ base.js:48 next @ base.js:49 (anonymous) @ base.js:272 Ue @ base.js:269 qra @ base.js:3681 AM @ base.js:3680 (anonymous) @ base.js:4916 wa @ base.js:48 next @ base.js:49 (anonymous) @ base.js:272 Ue @ base.js:269 S_ @ base.js:4916 (anonymous) @ base.js:4897 Promise.then (async) h @ base.js:4897 Kza @ base.js:4900 Qza @ base.js:4919 Vza @ base.js:4945 g.k.Ax @ base.js:8507 fT @ base.js:4944 h0 @ base.js:4956 L0 @ base.js:5089 g.k.playVideo @ base.js:8735 g.k.playVideo @ base.js:7528 a.F.<computed> @ base.js:3770 g.k.handleExternalCall @ base.js:7502 Y.a.B.<computed> @ base.js:3774 (anonymous) @ www-embed-player.js:793 p.Aa @ www-embed-player.js:855 p.ib @ www-embed-player.js:844 Yk.u @ www-embed-player.js:840 video.js:84 VIDEOJS: ERROR: (CODE:1005 undefined) Error while trying to play the video

I have updated to the latest version of chrome chrome://settings/help

And if I run ctrl+shift+n and run it in a incognito window it seems to work.

I thought it maybe related to chrome extension but I have disabled them all and it still giving the same errors.

You can recreated the issue by cloning this repo and running the simple.html example in chrome.

Screenshot 2021-01-20 at 19 22 47

tatet commented 3 years ago

This is the error I got with the same jsfiddle: https://jsfiddle.net/L4mkxht5/ Note that is NOT an autoplay issue. Definitely there is something weird here.

image

I don't understand this error when I CLICK on play button. Why is the first user interaction not received by the YouTube iframe?

jelmersdp commented 3 years ago

I have the same issue here. After pressing play the video loading stalls only in Chrome. Does some have a work-around for this?

JohnBernardsson commented 3 years ago

I just posted an issue with a terrible hack-work-around (use at your own risk), that I believe it has to do with this issue or is basically the same.

https://github.com/videojs/videojs-youtube/issues/593

jimmyfer commented 2 years ago

i cannot make this work, probably youtube detect if you are trusted or not, i mean something like that because it was working for me with a setTimeout of 3 seconds, now after a lot of test dont event work with setTimeout. Youtube detect if user interact with the dom, if that true then it work like a charm but of course that is out of our control. even simulating .click dont work lol. So..... if i'm not trusted for youtube then youtube is not trusted for me lol nothing else to do... i have to change the tech.

gentlemanjohn commented 4 months ago

I'm using another hacky workaround that works in my use case. I'm setting the player options to mute on load (to get the video to play in Chrome), but then set mute back to false on play: #593