Browse files

Added ratechange event handler to update GUI

  • Loading branch information...
1 parent 61edf67 commit 142afbf86fb280010f2d5f080eb6eef079988352 @thepag thepag committed Nov 5, 2013
Showing with 10 additions and 2 deletions.
  1. +10 −2 jquery.jplayer/jquery.jplayer.js
View
12 jquery.jplayer/jquery.jplayer.js
@@ -163,12 +163,12 @@
// "waiting", // jPlayer uses internally before bubbling.
// "playing", // jPlayer uses internally before bubbling.
"canplay",
- "canplaythrough",
+ "canplaythrough"
// "seeking", // jPlayer uses internally before bubbling.
// "seeked", // jPlayer uses internally before bubbling.
// "timeupdate", // jPlayer uses internally before bubbling.
// "ended", // jPlayer uses internally before bubbling.
- "ratechange"
+ // "ratechange" // jPlayer uses internally before bubbling.
// "durationchange" // jPlayer uses internally before bubbling.
// "volumechange" // jPlayer uses internally before bubbling.
];
@@ -1326,6 +1326,14 @@
self._trigger($.jPlayer.event.volumechange);
}
}, false);
+ mediaElement.addEventListener("ratechange", function() {
+ if(entity.gate) {
+ self.options.defaultPlaybackRate = mediaElement.defaultPlaybackRate;
+ self.options.playbackRate = mediaElement.playbackRate;
+ self._updatePlaybackRate();
+ self._trigger($.jPlayer.event.ratechange);
+ }
+ }, false);
mediaElement.addEventListener("suspend", function() { // Seems to be the only way of capturing that the iOS4 browser did not actually play the media from the page code. ie., It needs a user gesture.
if(entity.gate) {
self._seeked();

0 comments on commit 142afbf

Please sign in to comment.