jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370831 )

Change subject: Use native 'timeupdate' event for ogv.js
......................................................................


Use native 'timeupdate' event for ogv.js

Was previously simulated as didn't exist, but it does now.

Change-Id: Id2eca0884ecdc262a422f96664557afc4bacb2b6
---
M MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerOgvJs.js
1 file changed, 3 insertions(+), 13 deletions(-)

Approvals:
  jenkins-bot: Verified
  TheDJ: Looks good to me, approved



diff --git a/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerOgvJs.js 
b/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerOgvJs.js
index 7cd9420..d523f99 100644
--- a/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerOgvJs.js
+++ b/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerOgvJs.js
@@ -89,19 +89,9 @@
                                _this.onClipDone();
                        });
 
-                       // simulate timeupdate events, needed for subtitles
-                       // @todo switch this to native timeupdate event when 
available upstream
-                       var lastTime = 0,
-                               timeupdateInterval = 0.25;
-                       player.addEventListener( 'framecallback', function( 
event ) {
-                               var player = _this.getPlayerElement(),
-                                       now = player ? player.currentTime : 
lastTime;
-                               // Don't spam time updates on every frame
-                               if ( Math.abs( now - lastTime ) >= 
timeupdateInterval ) {
-                                       lastTime = now;
-                                       $( _this ).trigger( 'timeupdate', 
[event, _this.id] );
-                               }
-                       });
+                       player.addEventListener( 'timeupdate', function( event 
) {
+                               $( _this ).trigger( 'timeupdate', [event, 
_this.id] );
+                       } );
 
                        $( _this ).empty().append( player );
                        player.play();

-- 
To view, visit https://gerrit.wikimedia.org/r/370831
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id2eca0884ecdc262a422f96664557afc4bacb2b6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: Brion VIBBER <br...@wikimedia.org>
Gerrit-Reviewer: TheDJ <hartman.w...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to