mirror of
https://github.com/videojs/video.js.git
synced 2024-12-25 02:42:10 +02:00
@gkatsev fixed usage of textTracksToJson. closes #2797
This commit is contained in:
parent
2627e86db5
commit
0da23c1d8d
@ -13,6 +13,7 @@ CHANGELOG
|
||||
* @misteroneill exposed DOM helpers ([view](https://github.com/videojs/video.js/pull/2754))
|
||||
* @incompl fixed broken link to reduced test cases article ([view](https://github.com/videojs/video.js/pull/2801))
|
||||
* @zjruan updated text track prototype loops to blacklist constructor for IE8 ([view](https://github.com/videojs/video.js/pull/2565))
|
||||
* @gkatsev fixed usage of textTracksToJson ([view](https://github.com/videojs/video.js/pull/2797))
|
||||
|
||||
--------------------
|
||||
|
||||
|
@ -398,7 +398,7 @@
|
||||
{ "prompt": "text", "id": "prNum", "desc": "What is the the pull request number?" },
|
||||
{ "get": "{{meta.urls.repo_api}}/pulls/{{prNum}}", "desc": "Get the PR information", "id": "pr" },
|
||||
{ "get": "{{meta.urls.repo_api}}/pulls/{{prNum}}/commits", "desc": "Get the PR commits to access author info", "id": "prCommits" },
|
||||
[ "git checkout -b {{pr.user.login}}-{{pr.head.ref}} {{pr.base.ref}}", "Create a new branch for merging the changes" ],
|
||||
[ "git checkout -b {{pr.user.login}}/{{pr.head.ref}} {{pr.base.ref}}", "Create a new branch for merging the changes" ],
|
||||
[ "git fetch {{pr.head.repo.ssh_url}} {{pr.head.ref}}", "Fetch the changes" ],
|
||||
[ "git merge --no-commit --squash FETCH_HEAD", "Merge the changes in without committing so they can be squashed" ],
|
||||
[ "grunt test", "Run tests to make sure they still pass" ],
|
||||
|
@ -597,7 +597,7 @@ class Player extends Component {
|
||||
unloadTech_() {
|
||||
// Save the current text tracks so that we can reuse the same text tracks with the next tech
|
||||
this.textTracks_ = this.textTracks();
|
||||
this.textTracksJson_ = textTrackConverter.textTracksToJson(this);
|
||||
this.textTracksJson_ = textTrackConverter.textTracksToJson(this.tech_);
|
||||
|
||||
this.isReady_ = false;
|
||||
|
||||
|
@ -45,8 +45,7 @@ let trackToJson_ = function(track) {
|
||||
*/
|
||||
let textTracksToJson = function(tech) {
|
||||
|
||||
// Cannot use $$ here because it is not an instance of Tech
|
||||
let trackEls = tech.el().querySelectorAll('track');
|
||||
let trackEls = tech.$$('track');
|
||||
|
||||
let trackObjs = Array.prototype.map.call(trackEls, (t) => t.track);
|
||||
let tracks = Array.prototype.map.call(trackEls, function(trackEl) {
|
||||
|
@ -57,6 +57,10 @@ if (Html5.supportsNativeTextTracks()) {
|
||||
tt.addTrack_(emulatedTrack);
|
||||
|
||||
let tech = {
|
||||
$$() {
|
||||
return [nativeTrack];
|
||||
},
|
||||
|
||||
el() {
|
||||
return {
|
||||
querySelectorAll() {
|
||||
@ -103,6 +107,10 @@ if (Html5.supportsNativeTextTracks()) {
|
||||
|
||||
let addRemotes = 0;
|
||||
let tech = {
|
||||
$$() {
|
||||
return [nativeTrack];
|
||||
},
|
||||
|
||||
el() {
|
||||
return {
|
||||
querySelectorAll() {
|
||||
@ -167,6 +175,10 @@ q.test('textTracksToJson produces good json output for emulated only', function(
|
||||
tt.addTrack_(emulatedTrack);
|
||||
|
||||
let tech = {
|
||||
$$() {
|
||||
return [];
|
||||
},
|
||||
|
||||
el() {
|
||||
return {
|
||||
querySelectorAll() {
|
||||
@ -217,6 +229,10 @@ q.test('jsonToTextTracks calls addRemoteTextTrack on the tech with emulated trac
|
||||
|
||||
let addRemotes = 0;
|
||||
let tech = {
|
||||
$$() {
|
||||
return [];
|
||||
},
|
||||
|
||||
el() {
|
||||
return {
|
||||
querySelectorAll() {
|
||||
|
Loading…
Reference in New Issue
Block a user