sampotts / plyr

A simple HTML5, YouTube and Vimeo player
https://plyr.io
MIT License
26.59k stars 2.93k forks source link

Muting doesn't work for Vimeo videos in Chrome. #1084

Open elliottcoe opened 6 years ago

elliottcoe commented 6 years ago

Expected behaviour

To be able to add the muted: true property to the Plyr constructor and the video to be muted.

Actual behaviour

Video plays with sounds in Chrome.

Steps to reproduce

Create a div with provider set to vimeo and pass through the vimeo video id with data-plyr-embed-id. Instantiate the video with var hero_video = new Plyr('#hero_player_plyr', { autoplay: true, muted: true, volume: 0, controls: [] });

friday commented 6 years ago

It could be related to this:

https://github.com/sampotts/plyr/blob/master/src/js/plugins/vimeo.js#L93

But I'm guessing more likely to this:

https://github.com/sampotts/plyr/blob/master/src/js/plugins/vimeo.js#L194-L204.

If it's the latter, it shouldn't be hard to fix. Adding an extra condition to line 201 to check !player.muted should do it.

I have to focus on other things right now so help is wanted.

thomasaull commented 6 years ago

A temporary workaround, after initializing your plyr instance, do plyr.muted = true. This way it works

justinbansal commented 4 years ago

The settings works as intended if you have storage disabled as the user options get stored in the browser.

sitoexpress commented 4 years ago

Hi having the same issue: unable to mute vimeo video in both chrome and firefox. Tried to set muted=1 (or true) with data-plyr-config attribute, during initialization, after inizialization and in vimeo link: none of the methods worked.

bjarnef commented 3 years ago

I am having a similar issue with a Vimeo video.

const player = new Plyr('#player', {
    autoplay: true,
    volume: 0,
    muted: true,
    clickToPlay: false,
    loop: {
        active: true
    },
    fullscreen: {
        enabled: false,
        fallback: true,
        iosNative: false,
        container: null
    }
});

The following is stored in local storage, but still the Video isn't muted.

image

The workaround seems to fix this temporary though:

player.on('ready', () => {
    player.muted = true;
});