-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Emulate HTMLTrackElement to enable load event. #2804
Conversation
let track = tracks[i]; | ||
|
||
if (track['kind'] === this.kind_) { |
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.
Followed #1949
Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED Commit: d318bcc2d401d2744a7454e9c00bcd47435c0b4f (Please note that this is a fully automated comment.) |
|
||
import * as browser from '../utils/browser.js'; | ||
|
||
class HtmlTrackElementList { |
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.
Followed TextTrackList
even if this wasn't shimming anything.
Awesome, I'll take a look tomorrow. |
Will need help:
Works (OSX 10.10.5):
|
@@ -269,7 +271,15 @@ var loadTrack = function(src, track) { | |||
} | |||
|
|||
track.loaded_ = true; | |||
parseCues(responseBody, track); | |||
|
|||
if (typeof window['WebVTT'] !== 'function') { |
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.
add comments if this isn't an issue in any environment beyond local.
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 is for the alt/video.novtt.js
build.
Thanks, this is definitely the right track, if you will ;) |
}); | ||
|
||
if (browser.IS_IE8) { | ||
return this; |
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.
fix ^
Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED Commit: 54b35f881b1d1968f4c6e56ee65aac362145fcc7 (Please note that this is a fully automated comment.) |
…indow.WebVTT` is inlined): 1. Create a `TextTrack` 2. Added `TextTrack` to `TextTrackList` 3. Loaded `TextTrack.cues` (!= null) All before the `htmlTrackElement` was added to `this.remoteTextTrackEls()` within `addRemoteTextTrack()`.
…ks correctly from DOM. - Added documentation - Added player test - Added api test NOTE: important that `addTrack_` order matters in tech.js::addRemoteTextTrack.
6b29dbc
to
eec4a2c
Compare
@@ -835,6 +835,39 @@ test('createModal()', function() { | |||
strictEqual(player.children().indexOf(modal), -1, 'modal was removed from player\'s children'); | |||
}); | |||
|
|||
test('should return correct remote text track values', function () { |
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.
Not sure where this should go or how this should be tested.
- Note:
techOrder: ['html5']
techFaker
doesn't initialize the <track>
correctly, but fires the player.addRemoteTextTrack
correctly. Open to recommendations.
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.
I think it probably would be better to move this test into test/tracks/tracks.test.js
Tested
Tested
All passed. |
|
player is made ready asynchronously
We also should add some tests for the new functionality of |
I am down for better tests, but what specifically did you have in mind? The only new functionality specified for
|
Yep, basically just a simple test that verifies that when you call |
- Add html track element test
Sweet, LGTM. |
Merged! Thanks @chemoish. Also, thanks @OwenEdwards for the initial workup oh so long ago :) |
* upstream/stable: (479 commits) v5.4.4 @gkatsev switched to use custom vtt.js from npm. closes videojs#2905 v5.4.3 @gkatsev updated options customizer and github-release options. closes videojs#2903 v5.4.2 @gkatsev updated grunt-release config. closes videojs#2900 v5.4.1 @gkatsev added chg- and github- release for next releases. closes videojs#2899 v5.4.0 @gkatsev added ability to release next tag from master. closes videojs#2894 @gkatsev added nullcheck for cues in updateForTrack. Fixes videojs#2870. closes videojs#2896 @chemoish emulated HTMLTrackElement to enable track load events. closes videojs#2804 @gkatsev added a Player#reset method. Fixes videojs#2852. closes videojs#2880 @nick11703 changed multiline comments in sass with single-line comments. closes videojs#2827 @gkatsev added Player#tech. Fixes videojs#2617. closes videojs#2883 @misteroneill updated videojs-ie8 to 1.1.1. closes videojs#2869 v5.3.0 @imbcmdth added sourceOrder option for source-first ordering in selectSource. closes videojs#2847 @forbesjo updated formatTime to not go negative. closes videojs#2821 v5.2.4 ...
Figure out when track elements are loaded so we can manipulate cues without having to do setTimeout hacks.
Addresses #2784.
Also addresses (maybe) #2799.