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

Change subject: Allow parser tests to be run in any order
......................................................................

Allow parser tests to be run in any order

Having a player ID which increments throughout script execution does not
allow individual parser tests to be run with --regex. Also, my pending
parser test engine refactor changes the order in which the tests are
run and so breaks tests. Instead, add a hook which resets the serial
at the start of each test.

Change-Id: I561344cee8e279050be37356fbfa8e97d3b21017
(cherry picked from commit 8b8b191624591c0f4d447cb8c6634a9dde39ffd2)
---
M TimedMediaHandler.hooks.php
M TimedMediaTransformOutput.php
M tests/parserTests.txt
3 files changed, 34 insertions(+), 13 deletions(-)


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

diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php
index 81fdc3a..6e85b91 100644
--- a/TimedMediaHandler.hooks.php
+++ b/TimedMediaHandler.hooks.php
@@ -323,6 +323,7 @@
                // Add unit tests
                $wgHooks['UnitTestsList'][] = 
'TimedMediaHandlerHooks::registerUnitTests';
                $wgHooks['ParserTestTables'][] = 
'TimedMediaHandlerHooks::onParserTestTables';
+               $wgHooks['ParserTestGlobals'][] = 
'TimedMediaHandlerHooks::onParserTestGlobals';
 
                /**
                 * Add support for the "TimedText" NameSpace
@@ -621,6 +622,13 @@
        }
 
        /**
+        * Hook to reset player serial so that parser tests are not 
order-dependent
+        */
+       public static function onParserTestGlobals( &$globals ) {
+               TimedMediaTransformOutput::resetSerialForTest();
+       }
+
+       /**
         * Add JavaScript and CSS for special pages that may include timed media
         * but which will not fire the parser hook.
         *
diff --git a/TimedMediaTransformOutput.php b/TimedMediaTransformOutput.php
index 03ac47f..3b4a4b5 100644
--- a/TimedMediaTransformOutput.php
+++ b/TimedMediaTransformOutput.php
@@ -536,4 +536,8 @@
                $this->hashTime = $hash;
                return $this->hashTime;
        }
+
+       public static function resetSerialForTest() {
+               self::$serial = 1;
+       }
 }
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index 2050125..fb04e5f 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -3,12 +3,11 @@
 !! wikitext
 [[File:Video.ogv]]
 !! html
-<div class="mediaContainer" style="width:320px"><video id="mwe_player_1" 
poster="http://example.com/images/thumb/0/00/Video.ogv/320px--Video.ogv.jpg"; 
controls="" preload="none" style="width:320px;height:240px" class="kskin" 
data-durationhint="4.3666666666667" data-startoffset="0" 
data-mwtitle="Video.ogv" data-mwprovider="local"><source 
src="http://example.com/images/0/00/Video.ogv"; type="video/ogg; 
codecs=&quot;theora&quot;" data-title="Original Ogg file, 320 × 240 (590 kbps)" 
data-shorttitle="Ogg source" data-width="320" data-height="240" 
data-bandwidth="590013" data-framerate="30"/>Sorry, your browser either has 
JavaScript disabled or does not have any supported player.<br /> You can <a 
href="http://example.com/images/0/00/Video.ogv";>download the clip</a> or <a 
href="https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:TimedMediaHandler/Client_download";>download
 a player</a> to play the clip in your browser.</video></div>
+<div class="mediaContainer" style="width:320px"><video id="mwe_player_1" 
poster="http://example.com/images/thumb/0/00/Video.ogv/320px--Video.ogv.jpg"; 
controls="" preload="none" style="width:320px;height:240px" class="kskin" 
data-durationhint="4.3666666666667" data-startoffset="0" 
data-mwtitle="Video.ogv" data-mwprovider="local"><source 
src="http://example.com/images/0/00/Video.ogv"; type="video/ogg; 
codecs=&quot;theora&quot;" data-title="Original Ogg file, 320 × 240 (590 kbps)" 
data-shorttitle="Ogg source" data-width="320" data-height="240" 
data-bandwidth="590013" data-framerate="30"/></video></div>
 
 !! html+tidy
-<div class="mediaContainer" style="width:320px"><video id="mwe_player_0" 
poster="http://example.com/images/thumb/0/00/Video.ogv/320px--Video.ogv.jpg"; 
controls="" preload="none" style="width:320px;height:240px" class="kskin" 
data-durationhint="4.3666666666667" data-startoffset="0" 
data-mwtitle="Video.ogv" data-mwprovider="local">
-<source src="http://example.com/images/0/00/Video.ogv"; type="video/ogg; 
codecs=&quot;theora&quot;" data-title="Original Ogg file, 320 × 240 (590 kbps)" 
data-shorttitle="Ogg source" data-width="320" data-height="240" 
data-bandwidth="590013" data-framerate="30" />Sorry, your browser either has 
JavaScript disabled or does not have any supported player.<br />
-You can <a href="http://example.com/images/0/00/Video.ogv";>download the 
clip</a> or <a 
href="https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:TimedMediaHandler/Client_download";>download
 a player</a> to play the clip in your browser.</video></div>
+<div class="mediaContainer" style="width:320px"><video id="mwe_player_1" 
poster="http://example.com/images/thumb/0/00/Video.ogv/320px--Video.ogv.jpg"; 
controls="" preload="none" style="width:320px;height:240px" class="kskin" 
data-durationhint="4.3666666666667" data-startoffset="0" 
data-mwtitle="Video.ogv" data-mwprovider="local">
+<source src="http://example.com/images/0/00/Video.ogv"; type="video/ogg; 
codecs=&quot;theora&quot;" data-title="Original Ogg file, 320 × 240 (590 kbps)" 
data-shorttitle="Ogg source" data-width="320" data-height="240" 
data-bandwidth="590013" data-framerate="30" /></video></div>
 !!end
 
 !! test
@@ -16,13 +15,12 @@
 !! wikitext
 [[File:Video.ogv|thumb]]
 !! html
-<div class="thumb tright"><div class="thumbinner" style="width:182px;"><div 
id="mwe_player_4" class="PopUpMediaTransform" style="width:180px;" 
videopayload="&lt;div class=&quot;mediaContainer&quot; 
style=&quot;width:320px&quot;&gt;&lt;video id=&quot;mwe_player_5&quot; 
poster=&quot;http://example.com/images/thumb/0/00/Video.ogv/320px--Video.ogv.jpg&quot;
 controls=&quot;&quot; preload=&quot;none&quot; autoplay=&quot;&quot; 
style=&quot;width:320px;height:240px&quot; class=&quot;kskin&quot; 
data-durationhint=&quot;4.3666666666667&quot; data-startoffset=&quot;0&quot; 
data-mwtitle=&quot;Video.ogv&quot; 
data-mwprovider=&quot;local&quot;&gt;&lt;source 
src=&quot;http://example.com/images/0/00/Video.ogv&quot; type=&quot;video/ogg; 
codecs=&amp;quot;theora&amp;quot;&quot; data-title=&quot;Original Ogg file, 320 
× 240 (590 kbps)&quot; data-shorttitle=&quot;Ogg source&quot; 
data-width=&quot;320&quot; data-height=&quot;240&quot; 
data-bandwidth=&quot;590013&quot; data-framerate=&quot;30&quot;/&gt;Sorry, your 
browser either has JavaScript disabled or does not have any supported 
player.&lt;br /&gt;&#10;You can &lt;a 
href=&quot;http://example.com/images/0/00/Video.ogv&quot;&gt;download the 
clip&lt;/a&gt; or &lt;a 
href=&quot;https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:TimedMediaHandler/Client_download&quot;&gt;download
 a player&lt;/a&gt; to play the clip in your 
browser.&lt;/video&gt;&lt;/div&gt;"><img alt="File:Video.ogv" 
style="width:180px;height:135px" 
src="http://example.com/images/thumb/0/00/Video.ogv/180px--Video.ogv.jpg";></img><a
 href="http://example.com/images/0/00/Video.ogv"; title="Play media" 
target="new"><span class="play-btn-large"><span class="mw-tmh-playtext">Play 
media</span></span></a></div>  <div class="thumbcaption"><div 
class="magnify"><a href="/wiki/File:Video.ogv" class="internal" 
title="Enlarge"></a></div></div></div></div>
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><div 
id="mwe_player_1" class="PopUpMediaTransform" style="width:180px;" 
videopayload="&lt;div class=&quot;mediaContainer&quot; 
style=&quot;width:320px&quot;&gt;&lt;video id=&quot;mwe_player_2&quot; 
poster=&quot;http://example.com/images/thumb/0/00/Video.ogv/320px--Video.ogv.jpg&quot;
 controls=&quot;&quot; preload=&quot;none&quot; autoplay=&quot;&quot; 
style=&quot;width:320px;height:240px&quot; class=&quot;kskin&quot; 
data-durationhint=&quot;4.3666666666667&quot; data-startoffset=&quot;0&quot; 
data-mwtitle=&quot;Video.ogv&quot; 
data-mwprovider=&quot;local&quot;&gt;&lt;source 
src=&quot;http://example.com/images/0/00/Video.ogv&quot; type=&quot;video/ogg; 
codecs=&amp;quot;theora&amp;quot;&quot; data-title=&quot;Original Ogg file, 320 
× 240 (590 kbps)&quot; data-shorttitle=&quot;Ogg source&quot; 
data-width=&quot;320&quot; data-height=&quot;240&quot; 
data-bandwidth=&quot;590013&quot; 
data-framerate=&quot;30&quot;/&gt;&lt;/video&gt;&lt;/div&gt;"><img 
alt="File:Video.ogv" style="width:180px;height:135px" 
src="http://example.com/images/thumb/0/00/Video.ogv/180px--Video.ogv.jpg";></img><a
 href="http://example.com/images/0/00/Video.ogv"; title="Play media" 
target="new"><span class="play-btn-large"><span class="mw-tmh-playtext">Play 
media</span></span></a></div>  <div class="thumbcaption"><div 
class="magnify"><a href="/wiki/File:Video.ogv" class="internal" 
title="Enlarge"></a></div></div></div></div>
 
 !! html+tidy
 <div class="thumb tright">
 <div class="thumbinner" style="width:182px;">
-<div id="mwe_player_2" class="PopUpMediaTransform" style="width:180px;" 
videopayload="&lt;div class=&quot;mediaContainer&quot; 
style=&quot;width:320px&quot;&gt;&lt;video id=&quot;mwe_player_3&quot; 
poster=&quot;http://example.com/images/thumb/0/00/Video.ogv/320px--Video.ogv.jpg&quot;
 controls=&quot;&quot; preload=&quot;none&quot; autoplay=&quot;&quot; 
style=&quot;width:320px;height:240px&quot; class=&quot;kskin&quot; 
data-durationhint=&quot;4.3666666666667&quot; data-startoffset=&quot;0&quot; 
data-mwtitle=&quot;Video.ogv&quot; 
data-mwprovider=&quot;local&quot;&gt;&lt;source 
src=&quot;http://example.com/images/0/00/Video.ogv&quot; type=&quot;video/ogg; 
codecs=&amp;quot;theora&amp;quot;&quot; data-title=&quot;Original Ogg file, 320 
× 240 (590 kbps)&quot; data-shorttitle=&quot;Ogg source&quot; 
data-width=&quot;320&quot; data-height=&quot;240&quot; 
data-bandwidth=&quot;590013&quot; data-framerate=&quot;30&quot;/&gt;Sorry, your 
browser either has JavaScript disabled or does not have any supported 
player.&lt;br /&gt;
-You can &lt;a 
href=&quot;http://example.com/images/0/00/Video.ogv&quot;&gt;download the 
clip&lt;/a&gt; or &lt;a 
href=&quot;https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:TimedMediaHandler/Client_download&quot;&gt;download
 a player&lt;/a&gt; to play the clip in your 
browser.&lt;/video&gt;&lt;/div&gt;"><img alt="File:Video.ogv" 
style="width:180px;height:135px" 
src="http://example.com/images/thumb/0/00/Video.ogv/180px--Video.ogv.jpg"; /><a 
href="http://example.com/images/0/00/Video.ogv"; title="Play media" 
target="new"><span class="play-btn-large"><span class="mw-tmh-playtext">Play 
media</span></span></a></div>
+<div id="mwe_player_1" class="PopUpMediaTransform" style="width:180px;" 
videopayload="&lt;div class=&quot;mediaContainer&quot; 
style=&quot;width:320px&quot;&gt;&lt;video id=&quot;mwe_player_2&quot; 
poster=&quot;http://example.com/images/thumb/0/00/Video.ogv/320px--Video.ogv.jpg&quot;
 controls=&quot;&quot; preload=&quot;none&quot; autoplay=&quot;&quot; 
style=&quot;width:320px;height:240px&quot; class=&quot;kskin&quot; 
data-durationhint=&quot;4.3666666666667&quot; data-startoffset=&quot;0&quot; 
data-mwtitle=&quot;Video.ogv&quot; 
data-mwprovider=&quot;local&quot;&gt;&lt;source 
src=&quot;http://example.com/images/0/00/Video.ogv&quot; type=&quot;video/ogg; 
codecs=&amp;quot;theora&amp;quot;&quot; data-title=&quot;Original Ogg file, 320 
× 240 (590 kbps)&quot; data-shorttitle=&quot;Ogg source&quot; 
data-width=&quot;320&quot; data-height=&quot;240&quot; 
data-bandwidth=&quot;590013&quot; 
data-framerate=&quot;30&quot;/&gt;&lt;/video&gt;&lt;/div&gt;"><img 
alt="File:Video.ogv" style="width:180px;height:135px" 
src="http://example.com/images/thumb/0/00/Video.ogv/180px--Video.ogv.jpg"; /><a 
href="http://example.com/images/0/00/Video.ogv"; title="Play media" 
target="new"><span class="play-btn-large"><span class="mw-tmh-playtext">Play 
media</span></span></a></div>
 <div class="thumbcaption">
 <div class="magnify"><a href="/wiki/File:Video.ogv" class="internal" 
title="Enlarge"></a></div>
 </div>
@@ -37,7 +35,7 @@
 !! html
 <ul class="gallery mw-gallery-traditional">
                <li class="gallerybox" style="width: 155px"><div style="width: 
155px">
-                       <div class="thumb" style="width: 150px;"><div 
style="margin:30px auto;"><div id="mwe_player_6" class="PopUpMediaTransform" 
style="width:120px;" videopayload="&lt;div class=&quot;mediaContainer&quot; 
style=&quot;width:320px&quot;&gt;&lt;video id=&quot;mwe_player_7&quot; 
poster=&quot;http://example.com/images/thumb/0/00/Video.ogv/320px--Video.ogv.jpg&quot;
 controls=&quot;&quot; preload=&quot;none&quot; autoplay=&quot;&quot; 
style=&quot;width:320px;height:240px&quot; class=&quot;kskin&quot; 
data-durationhint=&quot;4.3666666666667&quot; data-startoffset=&quot;0&quot; 
data-mwtitle=&quot;Video.ogv&quot; 
data-mwprovider=&quot;local&quot;&gt;&lt;source 
src=&quot;http://example.com/images/0/00/Video.ogv&quot; type=&quot;video/ogg; 
codecs=&amp;quot;theora&amp;quot;&quot; data-title=&quot;Original Ogg file, 320 
× 240 (590 kbps)&quot; data-shorttitle=&quot;Ogg source&quot; 
data-width=&quot;320&quot; data-height=&quot;240&quot; 
data-bandwidth=&quot;590013&quot; data-framerate=&quot;30&quot;/&gt;Sorry, your 
browser either has JavaScript disabled or does not have any supported 
player.&lt;br /&gt;&#10;You can &lt;a 
href=&quot;http://example.com/images/0/00/Video.ogv&quot;&gt;download the 
clip&lt;/a&gt; or &lt;a 
href=&quot;https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:TimedMediaHandler/Client_download&quot;&gt;download
 a player&lt;/a&gt; to play the clip in your 
browser.&lt;/video&gt;&lt;/div&gt;"><img alt="File:Video.ogv" 
style="width:120px;height:90px" 
src="http://example.com/images/thumb/0/00/Video.ogv/120px--Video.ogv.jpg";></img><a
 href="http://example.com/images/0/00/Video.ogv"; title="Play media" 
target="new"><span class="play-btn-large"><span class="mw-tmh-playtext">Play 
media</span></span></a></div></div></div>
+                       <div class="thumb" style="width: 150px;"><div 
style="margin:30px auto;"><div id="mwe_player_1" class="PopUpMediaTransform" 
style="width:120px;" videopayload="&lt;div class=&quot;mediaContainer&quot; 
style=&quot;width:320px&quot;&gt;&lt;video id=&quot;mwe_player_2&quot; 
poster=&quot;http://example.com/images/thumb/0/00/Video.ogv/320px--Video.ogv.jpg&quot;
 controls=&quot;&quot; preload=&quot;none&quot; autoplay=&quot;&quot; 
style=&quot;width:320px;height:240px&quot; class=&quot;kskin&quot; 
data-durationhint=&quot;4.3666666666667&quot; data-startoffset=&quot;0&quot; 
data-mwtitle=&quot;Video.ogv&quot; 
data-mwprovider=&quot;local&quot;&gt;&lt;source 
src=&quot;http://example.com/images/0/00/Video.ogv&quot; type=&quot;video/ogg; 
codecs=&amp;quot;theora&amp;quot;&quot; data-title=&quot;Original Ogg file, 320 
× 240 (590 kbps)&quot; data-shorttitle=&quot;Ogg source&quot; 
data-width=&quot;320&quot; data-height=&quot;240&quot; 
data-bandwidth=&quot;590013&quot; 
data-framerate=&quot;30&quot;/&gt;&lt;/video&gt;&lt;/div&gt;"><img 
alt="File:Video.ogv" style="width:120px;height:90px" 
src="http://example.com/images/thumb/0/00/Video.ogv/120px--Video.ogv.jpg";></img><a
 href="http://example.com/images/0/00/Video.ogv"; title="Play media" 
target="new"><span class="play-btn-large"><span class="mw-tmh-playtext">Play 
media</span></span></a></div></div></div>
                        <div class="gallerytext">
                        </div>
                </div></li>
@@ -50,7 +48,7 @@
 !! wikitext
 [[File:Video.ogv|thumbtime=1:25]]
 !! html
-<div class="mediaContainer" style="width:320px"><video id="mwe_player_8" 
poster="http://example.com/images/thumb/0/00/Video.ogv/320px-seek%3D3.3666666666667-Video.ogv.jpg";
 controls="" preload="none" style="width:320px;height:240px" class="kskin" 
data-durationhint="4.3666666666667" data-startoffset="0" 
data-mwtitle="Video.ogv" data-mwprovider="local"><source 
src="http://example.com/images/0/00/Video.ogv"; type="video/ogg; 
codecs=&quot;theora&quot;" data-title="Original Ogg file, 320 × 240 (590 kbps)" 
data-shorttitle="Ogg source" data-width="320" data-height="240" 
data-bandwidth="590013" data-framerate="30"/>Sorry, your browser either has 
JavaScript disabled or does not have any supported player.<br /> You can <a 
href="http://example.com/images/0/00/Video.ogv";>download the clip</a> or <a 
href="https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:TimedMediaHandler/Client_download";>download
 a player</a> to play the clip in your browser.</video></div>
+<div class="mediaContainer" style="width:320px"><video id="mwe_player_1" 
poster="http://example.com/images/thumb/0/00/Video.ogv/320px-seek%3D3.3666666666667-Video.ogv.jpg";
 controls="" preload="none" style="width:320px;height:240px" class="kskin" 
data-durationhint="4.3666666666667" data-startoffset="0" 
data-mwtitle="Video.ogv" data-mwprovider="local"><source 
src="http://example.com/images/0/00/Video.ogv"; type="video/ogg; 
codecs=&quot;theora&quot;" data-title="Original Ogg file, 320 × 240 (590 kbps)" 
data-shorttitle="Ogg source" data-width="320" data-height="240" 
data-bandwidth="590013" data-framerate="30"/></video></div>
 
 !! end
 
@@ -59,7 +57,7 @@
 !! wikitext
 [[File:Video.ogv|start=1:25]]
 !! html
-<div class="mediaContainer" style="width:320px"><video id="mwe_player_9" 
poster="http://example.com/images/thumb/0/00/Video.ogv/320px-seek%3D3.3666666666667-Video.ogv.jpg";
 controls="" preload="none" style="width:320px;height:240px" class="kskin" 
data-durationhint="4.3666666666667" data-startoffset="0" 
data-mwtitle="Video.ogv" data-mwprovider="local"><source 
src="http://example.com/images/0/00/Video.ogv#t=00:00:03.366"; type="video/ogg; 
codecs=&quot;theora&quot;" data-title="Original Ogg file, 320 × 240 (590 kbps)" 
data-shorttitle="Ogg source" data-width="320" data-height="240" 
data-bandwidth="590013" data-framerate="30"/>Sorry, your browser either has 
JavaScript disabled or does not have any supported player.<br /> You can <a 
href="http://example.com/images/0/00/Video.ogv#t=00:00:03.366";>download the 
clip</a> or <a 
href="https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:TimedMediaHandler/Client_download";>download
 a player</a> to play the clip in your browser.</video></div>
+<div class="mediaContainer" style="width:320px"><video id="mwe_player_1" 
poster="http://example.com/images/thumb/0/00/Video.ogv/320px-seek%3D3.3666666666667-Video.ogv.jpg";
 controls="" preload="none" style="width:320px;height:240px" class="kskin" 
data-durationhint="4.3666666666667" data-startoffset="0" 
data-mwtitle="Video.ogv" data-mwprovider="local"><source 
src="http://example.com/images/0/00/Video.ogv#t=00:00:03.366"; type="video/ogg; 
codecs=&quot;theora&quot;" data-title="Original Ogg file, 320 × 240 (590 kbps)" 
data-shorttitle="Ogg source" data-width="320" data-height="240" 
data-bandwidth="590013" data-framerate="30"/></video></div>
 
 !! end
 
@@ -68,7 +66,7 @@
 !! wikitext
 [[File:Video.ogv|start=1:25|end=1:35]]
 !! html
-<div class="mediaContainer" style="width:320px"><video id="mwe_player_10" 
poster="http://example.com/images/thumb/0/00/Video.ogv/320px-seek%3D3.3666666666667-Video.ogv.jpg";
 controls="" preload="none" style="width:320px;height:240px" class="kskin" 
data-durationhint="4.3666666666667" data-startoffset="0" 
data-mwtitle="Video.ogv" data-mwprovider="local"><source 
src="http://example.com/images/0/00/Video.ogv#t=00:00:03.366,00:00:03.366"; 
type="video/ogg; codecs=&quot;theora&quot;" data-title="Original Ogg file, 320 
× 240 (590 kbps)" data-shorttitle="Ogg source" data-width="320" 
data-height="240" data-bandwidth="590013" data-framerate="30"/>Sorry, your 
browser either has JavaScript disabled or does not have any supported 
player.<br /> You can <a 
href="http://example.com/images/0/00/Video.ogv#t=00:00:03.366,00:00:03.366";>download
 the clip</a> or <a 
href="https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:TimedMediaHandler/Client_download";>download
 a player</a> to play the clip in your browser.</video></div>
+<div class="mediaContainer" style="width:320px"><video id="mwe_player_1" 
poster="http://example.com/images/thumb/0/00/Video.ogv/320px-seek%3D3.3666666666667-Video.ogv.jpg";
 controls="" preload="none" style="width:320px;height:240px" class="kskin" 
data-durationhint="4.3666666666667" data-startoffset="0" 
data-mwtitle="Video.ogv" data-mwprovider="local"><source 
src="http://example.com/images/0/00/Video.ogv#t=00:00:03.366,00:00:03.366"; 
type="video/ogg; codecs=&quot;theora&quot;" data-title="Original Ogg file, 320 
× 240 (590 kbps)" data-shorttitle="Ogg source" data-width="320" 
data-height="240" data-bandwidth="590013" data-framerate="30"/></video></div>
 
 !! end
 
@@ -77,7 +75,7 @@
 !! wikitext
 [[File:Video.ogv|alt=Test]]
 !! html
-<div class="mediaContainer" style="width:320px"><video id="mwe_player_11" 
poster="http://example.com/images/thumb/0/00/Video.ogv/320px--Video.ogv.jpg"; 
controls="" preload="none" style="width:320px;height:240px" class="kskin" 
data-durationhint="4.3666666666667" data-startoffset="0" 
data-mwtitle="Video.ogv" data-mwprovider="local"><source 
src="http://example.com/images/0/00/Video.ogv"; type="video/ogg; 
codecs=&quot;theora&quot;" data-title="Original Ogg file, 320 × 240 (590 kbps)" 
data-shorttitle="Ogg source" data-width="320" data-height="240" 
data-bandwidth="590013" data-framerate="30"/>Sorry, your browser either has 
JavaScript disabled or does not have any supported player.<br /> You can <a 
href="http://example.com/images/0/00/Video.ogv";>download the clip</a> or <a 
href="https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:TimedMediaHandler/Client_download";>download
 a player</a> to play the clip in your browser.</video></div>
+<div class="mediaContainer" style="width:320px"><video id="mwe_player_1" 
poster="http://example.com/images/thumb/0/00/Video.ogv/320px--Video.ogv.jpg"; 
controls="" preload="none" style="width:320px;height:240px" class="kskin" 
data-durationhint="4.3666666666667" data-startoffset="0" 
data-mwtitle="Video.ogv" data-mwprovider="local"><source 
src="http://example.com/images/0/00/Video.ogv"; type="video/ogg; 
codecs=&quot;theora&quot;" data-title="Original Ogg file, 320 × 240 (590 kbps)" 
data-shorttitle="Ogg source" data-width="320" data-height="240" 
data-bandwidth="590013" data-framerate="30"/></video></div>
 
 !! end
 
@@ -86,7 +84,7 @@
 !! wikitext
 [[File:Video.ogv|link=Example]]
 !! html
-<div class="mediaContainer" style="width:320px"><video id="mwe_player_12" 
poster="http://example.com/images/thumb/0/00/Video.ogv/320px--Video.ogv.jpg"; 
controls="" preload="none" style="width:320px;height:240px" class="kskin" 
data-durationhint="4.3666666666667" data-startoffset="0" 
data-mwtitle="Video.ogv" data-mwprovider="local"><source 
src="http://example.com/images/0/00/Video.ogv"; type="video/ogg; 
codecs=&quot;theora&quot;" data-title="Original Ogg file, 320 × 240 (590 kbps)" 
data-shorttitle="Ogg source" data-width="320" data-height="240" 
data-bandwidth="590013" data-framerate="30"/>Sorry, your browser either has 
JavaScript disabled or does not have any supported player.<br /> You can <a 
href="http://example.com/images/0/00/Video.ogv";>download the clip</a> or <a 
href="https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:TimedMediaHandler/Client_download";>download
 a player</a> to play the clip in your browser.</video></div>
+<div class="mediaContainer" style="width:320px"><video id="mwe_player_1" 
poster="http://example.com/images/thumb/0/00/Video.ogv/320px--Video.ogv.jpg"; 
controls="" preload="none" style="width:320px;height:240px" class="kskin" 
data-durationhint="4.3666666666667" data-startoffset="0" 
data-mwtitle="Video.ogv" data-mwprovider="local"><source 
src="http://example.com/images/0/00/Video.ogv"; type="video/ogg; 
codecs=&quot;theora&quot;" data-title="Original Ogg file, 320 × 240 (590 kbps)" 
data-shorttitle="Ogg source" data-width="320" data-height="240" 
data-bandwidth="590013" data-framerate="30"/></video></div>
 
 !! end
 
@@ -99,3 +97,14 @@
 
 !! end
 
+!! test
+Simple audio element
+!! wikitext
+[[File:Audio.oga]]
+!! html
+<div class="mediaContainer" style="width:180px"><audio id="mwe_player_1" 
controls="" preload="none" style="width:180px" class="kskin" 
data-durationhint="0.99875" data-startoffset="0" data-mwtitle="Audio.oga" 
data-mwprovider="local"><source src="http://example.com/images/4/41/Audio.oga"; 
type="audio/ogg; codecs=&quot;vorbis&quot;" data-title="Original Ogg file (41 
kbps)" data-shorttitle="Ogg source" data-width="0" data-height="0" 
data-bandwidth="41107"/></audio></div>
+
+!! html+tidy
+<div class="mediaContainer" style="width:180px"><audio id="mwe_player_1" 
controls="" preload="none" style="width:180px" class="kskin" 
data-durationhint="0.99875" data-startoffset="0" data-mwtitle="Audio.oga" 
data-mwprovider="local">
+<source src="http://example.com/images/4/41/Audio.oga"; type="audio/ogg; 
codecs=&quot;vorbis&quot;" data-title="Original Ogg file (41 kbps)" 
data-shorttitle="Ogg source" data-width="0" data-height="0" 
data-bandwidth="41107" /></audio></div>
+!!end

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

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

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

Reply via email to