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

Set video "muted" attribute as property in Parser.Util.toVirtualDom #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

meowgorithm
Copy link

This is a small change to allow parsed <video> elements to play in Chrome with the bundled toVirtualDom utility.

Chrome needs to set the muted attribute on <video> elements as a property in order for autoplay to work (See this thread on Elm Discourse). Note that this is only a Chrome requirement; videos will autoplay in Firefox and Safari with the current implementation.

So in short, this PR will allow the following to autoplay with Utils.toVirtualDom:

<video autoplay muted loop>
    <source src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" type="video/mp4">
</video>

I was careful to apply this change only to video elements. I know the code looks a bit funky; totally open if you prefer a different style of implementation.

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

Successfully merging this pull request may close these issues.

1 participant