-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Fixup tracks some more #2494
Fixup tracks some more #2494
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,7 +127,7 @@ class Html5 extends Tech { | |
|
||
// If the original tag is still there, clone and remove it. | ||
if (el) { | ||
const clone = el.cloneNode(false); | ||
const clone = el.cloneNode(true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is a deep clone necessary here (and not before)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Otherwise, we won't get tracks available on something like ios. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hopefully, that makes sense. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, that makes sense. |
||
el.parentNode.insertBefore(clone, el); | ||
Html5.disposeMediaElement(el); | ||
el = clone; | ||
|
@@ -148,21 +148,6 @@ class Html5 extends Tech { | |
}) | ||
); | ||
} | ||
|
||
if (this.options_.tracks) { | ||
for (let i = 0; i < this.options_.tracks.length; i++) { | ||
const track = this.options_.tracks[i]; | ||
let trackEl = document.createElement('track'); | ||
trackEl.kind = track.kind; | ||
trackEl.label = track.label; | ||
trackEl.srclang = track.srclang; | ||
trackEl.src = track.src; | ||
if ('default' in track) { | ||
trackEl.setAttribute('default', 'default'); | ||
} | ||
el.appendChild(trackEl); | ||
} | ||
} | ||
} | ||
|
||
// Update specific tag settings, in case they were overridden | ||
|
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 forces the buttons to update in case the video element has tracks from before we are able to register the handlers to update the buttons.