Skip to content

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