videojs / videojs-youtube

YouTube playback technology for Video.js
1.13k stars 547 forks source link

missing mute playerVar for autoplay #619

Open giveap opened 8 months ago

giveap commented 8 months ago

YT autoplay requires the mute option, but this does not seem to be supported.

playerVars: {mute: 1}

The following codepen has a working combination of attributes to enable autoplay even on iOS safari.

https://codepen.io/iounini/pen/mdWVJLB

mister-ben commented 8 months ago

You can use the standard muted attribute or player option, or {customVars: {muted: 1}} to set directly , https://github.com/videojs/videojs-youtube?tab=readme-ov-file#custom-player-options

giveap commented 8 months ago

Thanks! yes, having both set was the solution. "youtube": { "customVars": { "mute": 1 ,"playsinline": 1, }}