Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Videos not playing on mobile browsers #487

Open
KrysCrannor opened this issue May 30, 2022 · 4 comments
Open

Videos not playing on mobile browsers #487

KrysCrannor opened this issue May 30, 2022 · 4 comments

Comments

@KrysCrannor
Copy link

I'm using a template which uses YTPlayer.
While everything works on the desktop version of the site, it doesn't on mobile. I'm using version 3.3.9 and useOnMobile is set on true.
Js files are untouched. The properties used are:

ratio: 16/9,
containment: 'self',
quality: 'default',
startAt: 0,
stopAt: 36,
autoPlay: true,
loop: true,
mute: true,
showControls: false,
showYTLogo: false,
realfullscreen: true,
addRaster: false,
optimizeDisplay: true,
stopMovieOnBlur: true,
useOnMobile: true,

@jaydeete
Copy link

jaydeete commented Apr 6, 2023

The only way I was able to fix this was to hack the library itself. On line 702 of this file you will see that the param playsinline being set. It must be set to 1 for this to work in iPhones. For some reason the code that determines the value always evaluates to 0 ... so my solution was just to hard-code it to 1.
So replace :
'playsinline' : jQuery.mbBrowser.mobile && !YTPlayer.isPlayer ? 1 : 0,
with:
'playsinline' : 1,

@KrysCrannor
Copy link
Author

For some reasons it still doesn't work on both my android phone and every chromium based browser on desktop when using the console in mobile mode

@lchhieu
Copy link

lchhieu commented Jun 16, 2023

The same issue @pupunzi Do you have any idea to resolve this issue

@pravingaikwad07
Copy link

its working in latest version and build. refer: https://github.com/pupunzi/jquery.mb.YTPlayer/blob/master/dist/jquery.mb.YTPlayer.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants