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

Restore video tag attributes on tech change #1369

Closed

Conversation

dcharbonnier
Copy link

New attempt to fix this issue #1367 related to the webkit-playsinline attribute missing.

@heff
Copy link
Member

heff commented Jul 25, 2014

Thanks for this! Digging in now.

* @private
*/
vjs.setElementAttributes = function(el, attributes){
var keys = Object.keys(attributes);
Copy link
Member

Choose a reason for hiding this comment

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

I believe Object.keys will error in ie8. You can use vjs.obj.each instead.

@@ -32,6 +32,8 @@ vjs.Player = vjs.Component.extend({
init: function(tag, options, ready){
this.tag = tag; // Store the original tag used to set options

this.tagAttributes = (tag) ? vjs.getAttributeValues(tag) : {}; // Store the tag attributes used to restore html5 tech
Copy link
Member

Choose a reason for hiding this comment

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

Would it work to store this later in the file where we already run getAttributeValues?
https://github.com/dcharbonnier/video.js/blob/feature/video-attr-restore/src/js/player.js#L134

Copy link
Author

Choose a reason for hiding this comment

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

Let me try, that can solve two concerns but the code coverage looks quite low on this project so I'm afraid of such changes.

Copy link
Author

Choose a reason for hiding this comment

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

getTagSettings is a static method (as much as javascript permit it), accessing an attribute of the instance on this method seams strange to me, even if the reality is that we only use this method on the constructor. I don't think it's wrong but to make it right this imply more work, rename the method, remove the arguments, do you have a convention for "private" methods ?

@heff heff closed this in 527a33a Aug 4, 2014
heff added a commit that referenced this pull request Aug 4, 2014
@heff
Copy link
Member

heff commented Aug 4, 2014

@dcharbonnier I wanted to get this merged in for tomorrow's release, but check out this change log and let me know what you think.
527a33a

@dcharbonnier
Copy link
Author

good for me, thanks

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.

3 participants