-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
add/remove muted attribute #1283
Conversation
Unless the attribute is actually on the element, the browser doesn't recognise it as muted and won't autoplay. Also added missing volumechange handler to audio
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See below for a possible problem.
if (muted) { | ||
that.$media.attr("muted", ""); | ||
} else { | ||
that.$media.removeAttr("muted"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will add or remove the muted attribute when the mute is applied from outside of MediaElement, but it will not have the same effect if the volume is changed from inside MediaElement. For example, if I click the external mute control, the audio element gets a "muted" attribute. But if I then raise the volume in the player itself, the attribute remains. Do we need to account for this in the volumechange event handlers for consistency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me now, @edsilv!
Unless the attribute is actually on the element, the browser doesn't recognise it as muted and won't autoplay. Also added missing volumechange handler to audio