Permalink
Browse files

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...
1 parent fa39348 commit 4cc303419b8964265b509ac5821c0408a36721a8 @azatoth committed Mar 29, 2010
Showing with 8 additions and 3 deletions.
  1. +8 −3 jquery.video.js
View
@@ -379,9 +379,14 @@ $.widget("ui.video", {
self.currentProgressSpan.text(self._formatTime(self.element[0].duration * (ui.value/100)));
},
slide: function( e, ui ) {
- self._scrubberHoverUpdate.apply(self,[ui.handle, ui.value]);
- self.scrub.apply(self,[ui.value]);
- return true;
+ if( self.element[0].readyState === HTMLMediaElement.HAVE_NOTHING ) {
+ // We don't have any metadata, so scrubbing is not allowed
+ return false;
+ } else {
+ self._scrubberHoverUpdate.apply(self,[ui.handle, ui.value]);
+ self.scrub.apply(self,[ui.value]);
+ return true;
+ }
}
}
);

0 comments on commit 4cc3034

Please sign in to comment.