Skip to content

Commit

Permalink
fix: source inconsistencies
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonocasey committed May 9, 2018
1 parent ba2ae78 commit 428a904
Show file tree
Hide file tree
Showing 5 changed files with 190 additions and 192 deletions.
4 changes: 3 additions & 1 deletion src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -2612,9 +2612,11 @@ class Player extends Component {

if (!titleCaseEquals(sourceTech.tech, this.techName_)) {
this.changingSrc_ = true;

// load this technology with the chosen source
this.loadTech_(sourceTech.tech, sourceTech.source);
this.tech_.ready(() => {
this.changingSrc_ = false;
});
return false;
}

Expand Down
12 changes: 8 additions & 4 deletions src/js/tech/html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ class Html5 extends Tech {
constructor(options, ready) {
super(options, ready);

if (options.enableSourceset) {
this.setupSourcesetHandling_();
}

const source = options.source;
let crossoriginTracks = false;

Expand All @@ -52,6 +48,11 @@ class Html5 extends Tech {
this.handleLateInit_(this.el_);
}

// setup sourceset after late sourceset/init
if (options.enableSourceset) {
this.setupSourcesetHandling_();
}

if (this.el_.hasChildNodes()) {

const nodes = this.el_.childNodes;
Expand Down Expand Up @@ -117,6 +118,9 @@ class Html5 extends Tech {
* Dispose of `HTML5` media element and remove all tracks.
*/
dispose() {
if (this.el_.resetSourceset_) {
this.el_.resetSourceset_();
}
Html5.disposeMediaElement(this.el_);
this.options_ = null;

Expand Down
Loading

0 comments on commit 428a904

Please sign in to comment.