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

Solution: Can't play in Chrome (maybe Android too?) #456

Open
unremarkablegarden opened this issue Dec 11, 2021 · 2 comments
Open

Solution: Can't play in Chrome (maybe Android too?) #456

unremarkablegarden opened this issue Dec 11, 2021 · 2 comments

Comments

@unremarkablegarden
Copy link

Line 8555 of vue-plyr.ssr.js:

c.setAttribute("src", u), c.setAttribute("allowfullscreen", ""), c.setAttribute("allow", "autoplay,fullscreen,picture-in-picture"), is$1.empty(s) || c.setAttribute("referrerPolicy", s);

You need to set the allow attributes separated by semicolon not commas, or else it doesn't load properly. You can't fix it by setting the attr again after with JS. Needs to be fixed in the source code. Corrected:

c.setAttribute("src", u), c.setAttribute("allowfullscreen", ""), c.setAttribute("allow", "autoplay;fullscreen;picture-in-picture"), is$1.empty(s) || c.setAttribute("referrerPolicy", s);

@unremarkablegarden unremarkablegarden changed the title Can't play in Chrome (maybe Android too?) Solution: Can't play in Chrome (maybe Android too?) Dec 11, 2021
@gierloff
Copy link

gierloff commented Feb 14, 2022

Can you please fix this? I had to use the fork from skjnldsv to make it work (to fix play issue in chrome, I could only play the videos if they were muted)

npm i @skjnldsv/vue-plyr

AND

npm i vue-plyr

then

In nuxt, at plugins/plyr.js:

import Vue from 'vue'
import VuePlyr from '@skjnldsv/vue-plyr/dist/vue-plyr.ssr.js'
import 'vue-plyr/dist/vue-plyr.css'

Vue.use(VuePlyr, {
  plyr: {}
})

@sjoerdoudman
Copy link

sjoerdoudman commented May 10, 2023

Great Gierloff,

thanks! This finally pointed me into the right direction of being able to get this to work in Nuxt 3.
+1 for please fixing this in vue-plyr instead of having to use this fork!

By the way: it seems you no longer have to use /dist/vue-plyr.ssr.js (this file does not exist), just
import VuePlyr from '@skjnldsv/vue-plyr'

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

3 participants