Skip to content

Commit

Permalink
src() returns mw src, currentSrc() returns set src
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev committed Dec 28, 2016
1 parent fb65639 commit 0276e92
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -841,12 +841,8 @@ class Player extends Component {
techOptions.tag = this.tag;
}

if (source) {
this.currentType_ = source.type;

if (source.src === this.cache_.src && this.cache_.currentTime > 0) {
techOptions.startTime = this.cache_.currentTime;
}
if (source && source.src === this.cache_.src && this.cache_.currentTime > 0) {
techOptions.startTime = this.cache_.currentTime;
}

// Initialize tech instance
Expand Down Expand Up @@ -2174,7 +2170,7 @@ class Player extends Component {
*/
src(source) {
if (source === undefined) {
return this.techGet_('src');
return this.cache_.src;
}

this.changingSrc_ = true;
Expand All @@ -2193,7 +2189,8 @@ class Player extends Component {
}

this.cache_.source = src;
this.cache_.src = src.src;

this.currentType_ = src.type;

middleware.setSource(Fn.bind(this, this.setTimeout), src, (src_, mws) => {
this.middleware_ = mws;
Expand All @@ -2217,6 +2214,7 @@ class Player extends Component {
return;
}

this.cache_.src = src_.src;
middleware.setTech(mws, this.tech_);
});

Expand Down Expand Up @@ -2365,7 +2363,7 @@ class Player extends Component {
* The current source
*/
currentSrc() {
return this.techGet_('currentSrc') || this.cache_.src || '';
return this.cache_.source && this.cache_.source.src || '';
}

/**
Expand Down

0 comments on commit 0276e92

Please sign in to comment.