Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

style fixes for play() update and tests, detabbed the files. [#36 and #…

  • Loading branch information...
commit 49fa19ee8d4da0a4c9b07fcd0861e11b81c42c99 1 parent 3e9f472
Christopher De Cairos authored May 17, 2012
20  popcorn.sequence.js
@@ -323,17 +323,13 @@
323 323
 
324 324
     play: function() {
325 325
 
326  
-      if (((this.queue.length-1) == this.active) &&
327  
-           (this.inOuts["ofVideos"][this.active]["out"] >= Math.round(this.queue[this.active].currentTime)))
328  
-    	{
329  
-        
330  
-  			this.jumpTo(0);
331  
-  			
332  
-  		} else {
333  
-  			
334  
-     		this.queue[ this.active ].play();
335  
-     		
336  
-  		}
  326
+      if ( ( ( this.queue.length - 1 ) === this.active ) &&
  327
+           ( this.inOuts[ "ofVideos" ][ this.active ][ "out" ] >= Math.round( this.queue[ this.active ].currentTime ) ) )
  328
+      {
  329
+        this.jumpTo( 0 );
  330
+      } else {
  331
+        this.queue[ this.active ].play();
  332
+      }
337 333
 
338 334
       return this;
339 335
     },
@@ -461,7 +457,7 @@
461 457
       return currentTime;
462 458
     },
463 459
     jumpTo: function( time ) {
464  
-    
  460
+
465 461
       if ( time < 0 || time > this.duration() ) {
466 462
         return this;
467 463
       }
35  test/sequence.unit.js
@@ -737,17 +737,17 @@ asyncTest("pause() and play()", 3, function() {
737 737
   seq.on( "loadedmetadata", function() {
738 738
 
739 739
     seq.cue( 2, function() {
740  
-                  
  740
+
741 741
     equal( seq.playing, true, "Sequence is playing" );
742  
-    
  742
+
743 743
     seq.pause();
744 744
 
745 745
     }).on ("pause", function() {
746 746
       seq.off( "pause" );
747  
-    	equal( seq.playing, false, "Sequence is paused" );
748  
-    	seq.play();
  747
+      equal( seq.playing, false, "Sequence is paused" );
  748
+      seq.play();
749 749
     }).cue(4,function(){
750  
-    	equal( seq.playing, true, "Sequence is playing again" );
  750
+      equal( seq.playing, true, "Sequence is playing again" );
751 751
       seq.remove();
752 752
       start();
753 753
     });
@@ -756,30 +756,29 @@ asyncTest("pause() and play()", 3, function() {
756 756
 });
757 757
 
758 758
 
759  
-asyncTest("play() after sequence ended", 2, function() {
  759
+asyncTest( "play() after sequence ended", 2, function() {
760 760
 
761 761
   var seq = Popcorn.sequence( "video-sequence-b", remoteMediaList ),
762  
-      hasRun = false,
763  
-      endet = 0;
764  
-                  
  762
+      ended = 0;
  763
+
765 764
   seq.on( "loadedmetadata", function() {
766 765
 
767 766
     seq.on( "pause", function() {
768  
-       if (seq.currentTime() >= seq.duration()) {
  767
+       if ( seq.currentTime() >= seq.duration() ) {
769 768
 
770  
-          if (!seq.playing) {
771  
-            endet = 1;
  769
+          if ( !seq.playing ) {
  770
+            ended = 1;
772 771
           }
773  
-                  		    
  772
+
774 773
           seq.play();
775  
-                  		    
776  
-          seq.cue(2, function() {
777  
-                  		    	
  774
+
  775
+          seq.cue( 2, function() {
  776
+
778 777
             start();
779  
-            equal( endet, 1, "Sequence ended" );
  778
+            equal( ended, 1, "Sequence ended" );
780 779
             equal( seq.active, 0, "Sequence cycle started from beginning" );
781  
-            hasRun = true;
782 780
             seq.remove();
  781
+            start();
783 782
           })
784 783
         }
785 784
       })

0 notes on commit 49fa19e

Please sign in to comment.
Something went wrong with that request. Please try again.