Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[#1428] Null wrapper double interval issue fixed. #280

Open
wants to merge 2 commits into from

1 participant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 1, 2013
  1. @ScottDowne
Commits on Feb 2, 2013
  1. @ScottDowne

    [#1428] Internal null wrapper has an internal core interval needs to …

    ScottDowne authored
    …be maintained on its own because it can be called on its own.
This page is out of date. Refresh to see the latest.
Showing with 16 additions and 5 deletions.
  1. +16 −5 wrappers/null/popcorn.HTMLNullVideoElement.js
View
21 wrappers/null/popcorn.HTMLNullVideoElement.js
@@ -26,6 +26,7 @@
this.currentTime = options.currentTime || 0;
this.duration = options.duration || NaN;
this.playInterval = null;
+ this.paused = true;
this.ended = options.endedCallback || Popcorn.nop;
}
@@ -43,12 +44,18 @@
play: function() {
var video = this;
- this.playInterval = setInterval( function() { nullPlay( video ); },
- DEFAULT_UPDATE_RESOLUTION_MS );
+ if ( this.paused ) {
+ this.paused = false;
+ this.playInterval = setInterval( function() { nullPlay( video ); },
+ DEFAULT_UPDATE_RESOLUTION_MS );
+ }
},
pause: function() {
- clearInterval( this.playInterval );
+ if ( !this.paused ) {
+ this.paused = true;
+ clearInterval( this.playInterval );
+ }
},
seekTo: function( aTime ) {
@@ -245,7 +252,9 @@
return;
}
player.play();
- onPlay();
+ if ( impl.paused ) {
+ onPlay();
+ }
};
function onPause() {
@@ -260,7 +269,9 @@
return;
}
player.pause();
- onPause();
+ if ( !impl.paused ) {
+ onPause();
+ }
};
function onEnded() {
Something went wrong with that request. Please try again.