Aaron Schulz has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/325825 )

Change subject: Make TimedMediaTransformOutput::$serial logic clearer
......................................................................

Make TimedMediaTransformOutput::$serial logic clearer

Change-Id: Ib51e030e3e05c6739d9433631a9225a7af55024a
---
M TimedMediaTransformOutput.php
1 file changed, 8 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/25/325825/1

diff --git a/TimedMediaTransformOutput.php b/TimedMediaTransformOutput.php
index 03ac47f..8953711 100644
--- a/TimedMediaTransformOutput.php
+++ b/TimedMediaTransformOutput.php
@@ -1,7 +1,7 @@
 <?php
 
 class TimedMediaTransformOutput extends MediaTransformOutput {
-       private static $serial = 0;
+       protected static $serial = 0;
 
        // Video file sources object lazy init in getSources()
        // TODO these vars should probably be private
@@ -188,8 +188,11 @@
        function getImagePopUp() {
                // pop up videos set the autoplay attribute to true:
                $autoPlay = true;
+               $id = TimedMediaTransformOutput::$serial;
+               ++TimedMediaTransformOutput::$serial;
+
                return Xml::tags( 'div', [
-                               'id' => self::PLAYER_ID_PREFIX . 
TimedMediaTransformOutput::$serial++,
+                               'id' => self::PLAYER_ID_PREFIX . $id,
                                'class' => 'PopUpMediaTransform',
                                'style' => "width:" . $this->getPlayerWidth() . 
"px;",
                                'videopayload' => $this->getHtmlMediaTagOutput( 
$this->getPopupPlayerSize(), $autoPlay ),
@@ -419,8 +422,10 @@
                        $height .= 'px';
                }
 
+               $id = TimedMediaTransformOutput::$serial;
+               ++TimedMediaTransformOutput::$serial;
                $mediaAttr = [
-                       'id' => self::PLAYER_ID_PREFIX . 
TimedMediaTransformOutput::$serial++,
+                       'id' => self::PLAYER_ID_PREFIX . $id,
                        // Get the correct size:
                        'poster' => $posterUrl,
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib51e030e3e05c6739d9433631a9225a7af55024a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: REL1_27
Gerrit-Owner: Aaron Schulz <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to