Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Scrubbing prevetion

Prevent scrubbing if we are in a state without even metadata
we do this on start, stop and slide events.
  • Loading branch information...
commit 4cc303419b8964265b509ac5821c0408a36721a8 1 parent fa39348
Carl Fürstenberg authored

Showing 1 changed file with 8 additions and 3 deletions. Show diff stats Hide diff stats

  1. 11  jquery.video.js
11  jquery.video.js
@@ -379,9 +379,14 @@ $.widget("ui.video", {
379 379
 						self.currentProgressSpan.text(self._formatTime(self.element[0].duration * (ui.value/100)));
380 380
 					},
381 381
 					slide: function( e, ui ) {
382  
-						self._scrubberHoverUpdate.apply(self,[ui.handle, ui.value]);
383  
-						self.scrub.apply(self,[ui.value]);
384  
-						return true;
  382
+						if( self.element[0].readyState === HTMLMediaElement.HAVE_NOTHING ) {
  383
+							// We don't have any metadata, so scrubbing is not allowed
  384
+							return false;
  385
+						} else {
  386
+							self._scrubberHoverUpdate.apply(self,[ui.handle, ui.value]);
  387
+							self.scrub.apply(self,[ui.value]);
  388
+							return true;
  389
+						}
385 390
 					}
386 391
 				}
387 392
 			);

0 notes on commit 4cc3034

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