Skip to content

Commit

Permalink
Merge pull request #72 from bbc/fix-videonode-crash
Browse files Browse the repository at this point in the history
Fix videonode crash
  • Loading branch information
PTaylour authored Mar 9, 2018
2 parents 0430e03 + 7b02365 commit cc83357
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dist/videocontext.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/videocontext.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/api/SourceNodes_videonode.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ <h1 class="page-title">Source: SourceNodes/videonode.js</h1>
} else {
this._element.src = this._elementURL;
}

for (let key in this._attributes) {
this._element[key] = this._attributes[key];
}
Expand Down Expand Up @@ -197,7 +197,7 @@ <h1 class="page-title">Source: SourceNodes/videonode.js</h1>
}
}

if (this._startTime - this._currentTime &lt; this._preloadTime &amp;&amp; this._state !== SOURCENODESTATE.waiting &amp;&amp; this._state !== SOURCENODESTATE.ended)this._load();
if (this._startTime - this._currentTime &lt;= this._preloadTime &amp;&amp; this._state !== SOURCENODESTATE.waiting &amp;&amp; this._state !== SOURCENODESTATE.ended)this._load();

if (this._state === SOURCENODESTATE.playing){
if (this._playbackRateUpdated)
Expand Down
2 changes: 1 addition & 1 deletion docs/dist/videocontext.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/dist/videocontext.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/SourceNodes/canvasnode.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CanvasNode extends SourceNode {
_load(){
super._load();
this._ready = true;
this._triggerCallbacks("loaded");
this._triggerCallbacks("loaded");
}

_unload(){
Expand All @@ -33,11 +33,11 @@ class CanvasNode extends SourceNode {
this._unload();
}
}

_update(currentTime){
//if (!super._update(currentTime)) return false;
super._update(currentTime);
if (this._startTime - this._currentTime < this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load();
if (this._startTime - this._currentTime <= this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load();

if (this._state === SOURCENODESTATE.playing){
return true;
Expand Down
4 changes: 2 additions & 2 deletions src/SourceNodes/imagenode.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ class ImageNode extends SourceNode {
}else{
super._update(currentTime);
}
if (this._startTime - this._currentTime < this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load();

if (this._startTime - this._currentTime <= this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load();

if (this._state === SOURCENODESTATE.playing){
return true;
Expand Down
4 changes: 2 additions & 2 deletions src/SourceNodes/videonode.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class VideoNode extends SourceNode {
} else {
this._element.src = this._elementURL;
}

for (let key in this._attributes) {
this._element[key] = this._attributes[key];
}
Expand Down Expand Up @@ -169,7 +169,7 @@ class VideoNode extends SourceNode {
}
}

if (this._startTime - this._currentTime < this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load();
if (this._startTime - this._currentTime <= this._preloadTime && this._state !== SOURCENODESTATE.waiting && this._state !== SOURCENODESTATE.ended)this._load();

if (this._state === SOURCENODESTATE.playing){
if (this._playbackRateUpdated)
Expand Down

0 comments on commit cc83357

Please sign in to comment.