Plyr: [V3] muted attribute is not working

Created on 27 Mar 2018  路  15Comments  路  Source: sampotts/plyr

Expected behaviour

<video muted autoplay> should play the video with muted audio.

Actual behaviour

plyr.js does not respect the muted and does not mute the video.

Environment

  • Browser: Firefox 58
  • Operating System: Ubuntu Linux
  • Plyr: 3.0.3
Bug Replicated

All 15 comments

Seems like even this does not work:

new Plyr(element, {
    muted: true,
});

Sorry this must be a regression somewhere. Should be a quick fix.

On version 3.0.3 does this work for you?

var api = new Plyr(element, {
    muted: true
});
api.pause();

The video does not pause for me.

Try this:

var api = new Plyr(element, {
    muted: true
});
api.on('ready', () => { 
    api.pause();
});

This should be fixed in the latest version 馃憤

Not working in the latest version.
Adding
const player = new Plyr('#player', {muted:true, controls: ['play', 'progress', 'current-time', 'mute', 'volume', 'fullscreen']}); or muted in the video, none of them mute the sound.

They won't if you've previously set the muted state and have it in local storage. Obviously the users settings overwrite the defaults. Try clearing your plyr local storage key.

Ups! Thank you.

Did that work? :)

Yes but in a strange way. So the muted works from the inline video tag. But if I don't specify nothing in the video and use muted:true it makes nothing. Meaning, the options itself are not working, only the ones set on video and if I set none Plyr don't overwrite the settings, it's supposed to be like that ?

I've also tested now in Firefox and it's ignoring everything.
Even with $("#video_loop").prop('muted', true); it makes nothing in firefox. Strange.

Still not working as expected.
But I got it working with the workaround on the 'ready' event.

From what I see, the problem is that Plyr keep informations in the localStorage. To reproduce the behavior.
On a webpage, init a plyr player with muted & autoplay
Load the page for the first time (sound is muted)
Activate the sound
Reload the page (sound isn't muted)

Is it the wanted behavior?

Any news on this?

Once you unmute, everything is playing with sound after that

Plyr is storing it in browser storage and its taking precedent over the muted attribute. Kind of a bad design because videos won't autoplay unless they're muted. Hard to say what the solution is, I'm just sick of being told 'oh you didn't interact with the DOM we can't start this video', weird.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Antonio-Laguna picture Antonio-Laguna  路  3Comments

muuvmuuv picture muuvmuuv  路  3Comments

MTyson picture MTyson  路  3Comments

elliottcoe picture elliottcoe  路  4Comments

Lycanthrope picture Lycanthrope  路  4Comments