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

fix: make boolean attributes set and check both the associated property and the attribute #4562

Merged
merged 7 commits into from
Aug 15, 2017

Conversation

gkatsev
Copy link
Member

@gkatsev gkatsev commented Aug 11, 2017

I don't think this is quite complete yet but this is the initial implementation for making boolean attributes like muted set the property video.muted = {{boolean}} and the attribute video.setAttribute('muted', 'muted') when changing the value.
Also, in html5's createEl, we were setting/updating attributes for various properties but we were only setting the attributes and not also the properties but also autoplay was happening first rather than last which caused autoplay to fail because muted and playsinline weren't necessary set by that time.

@gkatsev
Copy link
Member Author

gkatsev commented Aug 11, 2017

Fixes #4351

@@ -375,7 +375,7 @@ export function getAttributes(tag) {
// known boolean attributes
// we can check for matching boolean properties, but older browsers
// won't know about HTML5 boolean attributes that we still read from
const knownBooleans = ',' + 'autoplay,controls,loop,muted,default' + ',';
const knownBooleans = ',' + 'autoplay,controls,playsinline,loop,muted,default' + ',';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should default here be defaultMuted?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is supposed to be default because <track> els use a default attribute. Going to add defaultMuted in here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

Copy link
Member

@misteroneill misteroneill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gkatsev gkatsev merged commit d668c49 into master Aug 15, 2017
@gkatsev gkatsev deleted the fix-boolean-prop-attrs branch August 15, 2017 21:02
atefBB pushed a commit to atefBB/video.js that referenced this pull request Aug 16, 2017
…ty and the attribute (videojs#4562)

Make boolean attributes like muted set the property video.muted = {{boolean}} and the attribute video.setAttribute('muted', 'muted') when changing the value.
Also, in html5's createEl, we were setting/updating attributes for various properties but we were only setting the attributes and not also the properties but also autoplay was happening first rather than last which caused autoplay to fail because muted and playsinline weren't necessary set by that time.

Fix videojs#4351.
gkatsev added a commit that referenced this pull request Sep 26, 2017
…ty and the attribute

Make boolean attributes like muted set the property video.muted = {{boolean}} and the attribute video.setAttribute('muted', 'muted') when changing the value.
Also, in html5's createEl, we were setting/updating attributes for various properties but we were only setting the attributes and not also the properties but also autoplay was happening first rather than last which caused autoplay to fail because muted and playsinline weren't necessary set by that time.

This is the 5.x version of #4562.

Fix #4351.
misteroneill pushed a commit that referenced this pull request Oct 2, 2017
…ty and the attribute (#4631)

Make boolean attributes like muted set the property video.muted = {{boolean}} and the attribute video.setAttribute('muted', 'muted') when changing the value.
Also, in html5's createEl, we were setting/updating attributes for various properties but we were only setting the attributes and not also the properties but also autoplay was happening first rather than last which caused autoplay to fail because muted and playsinline weren't necessary set by that time.

This is the 5.x version of #4562.

Fix #4351.
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.

2 participants