Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/EmbedPlayer/players/mw.EmbedPlayer.js |
— | — | @@ -147,10 +147,8 @@ |
148 | 148 | // also see: http://wiki.xiph.org/ROE |
149 | 149 | "roe" : null, |
150 | 150 | |
151 | | - // If serving an ogg_chop segment use this to offset the presentation |
152 | | - // time |
153 | | - // ( for some plugins that use ogg page time rather than presentation |
154 | | - // time ) |
| 151 | + // If serving an ogg_chop segment use this to offset the presentation time |
| 152 | + // ( for some plugins that use ogg page time rather than presentation time ) |
155 | 153 | "startOffset" : 0, |
156 | 154 | |
157 | 155 | // Thumbnail (same as poster) |
— | — | @@ -1345,9 +1343,9 @@ |
1346 | 1344 | } |
1347 | 1345 | |
1348 | 1346 | if ( !_this.duration && $( element ).attr( 'data-durationhint' ) ) { |
1349 | | - _this.data-durationhint = $( element ).attr( 'data-durationhint' ); |
| 1347 | + _this['data-durationhint'] = $( element ).attr( 'data-durationhint' ); |
1350 | 1348 | // Convert duration hint if needed: |
1351 | | - _this.duration = mw.npt2seconds( _this.data-durationhint ); |
| 1349 | + _this.duration = mw.npt2seconds( _this['data-durationhint'] ); |
1352 | 1350 | } |
1353 | 1351 | |
1354 | 1352 | // Make sure duration is a float: |
— | — | @@ -2386,7 +2384,7 @@ |
2387 | 2385 | } |
2388 | 2386 | |
2389 | 2387 | if( this.duration ) { |
2390 | | - params.data-durationhint = parseFloat( this.duration ); |
| 2388 | + params['data-durationhint'] = parseFloat( this.duration ); |
2391 | 2389 | } |
2392 | 2390 | iframeUrl += $j.param( params ); |
2393 | 2391 | |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/EmbedPlayer/EmbedPlayer.loader.js |
— | — | @@ -108,7 +108,7 @@ |
109 | 109 | mediaWiki.loader.using( dependencySet, function(){ |
110 | 110 | setTimeout( function(){ |
111 | 111 | mw.processEmbedPlayers( playerSelect, readyCallback ); |
112 | | - }, 300); |
| 112 | + }, 500); |
113 | 113 | }); |
114 | 114 | }; |
115 | 115 | |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/MediaWikiSupport/tests/Player_mwtitle.html |
— | — | @@ -1,9 +1,18 @@ |
| 2 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
| 3 | +"http://www.w3.org/TR/html4/loose.dtd"> |
| 4 | +<html> |
| 5 | +<head> |
| 6 | + <title> Sample Player with assets loaded from commons </title> |
| 7 | + <script type="text/javascript" src="../../../load.php?modules=startup&only=scripts"></script> |
| 8 | +</head> |
| 9 | +<body> |
| 10 | +<h3> Sample Player with assets loaded from commons </h3> |
2 | 11 | |
3 | | - |
4 | | - |
5 | 12 | <video id="v0" tabindex="0" style="width: 512px; height: 288px;" |
6 | 13 | data-durationhint="7:52" |
7 | | -data-="Yochai_Benkler_-_On_Autonomy,_Control_and_Cultural_Experience.ogg" |
8 | | -apiprovider="commons" |
| 14 | +data-mwtitle="Yochai_Benkler_-_On_Autonomy,_Control_and_Cultural_Experience.ogg" |
| 15 | +data-mwprovider="commons" |
9 | 16 | class="kskin"> |
10 | | -</video> |
\ No newline at end of file |
| 17 | +</video> |
| 18 | +</body> |
| 19 | +</html> |
\ No newline at end of file |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/MediaWikiSupport/resources/MediaWikiSupportPlayer.js |
— | — | @@ -94,7 +94,7 @@ |
95 | 95 | } |
96 | 96 | |
97 | 97 | // Update the css for the player interface |
98 | | - $( embedPlayer ).css( 'height', _this.height); |
| 98 | + $( embedPlayer ).css( 'height', embedPlayer.height); |
99 | 99 | |
100 | 100 | callback(); |
101 | 101 | }); |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/TimedText/loader.js |
— | — | @@ -1,125 +0,0 @@ |
2 | | -/** |
3 | | -* TimedText loader. |
4 | | -*/ |
5 | | -// Scope everything in "mw" ( keeps the global namespace clean ) |
6 | | -( function( mw, $ ) { |
7 | | - |
8 | | - mw.addResourcePaths( { |
9 | | - "mw.TimedText" : "mw.TimedText.js", |
10 | | - "mw.style.TimedText" : "css/mw.style.TimedText.css", |
11 | | - |
12 | | - "mw.TimedTextEdit" : "mw.TimedTextEdit.js", |
13 | | - "mw.style.TimedTextEdit" : "css/mw.style.TimedTextEdit.css", |
14 | | - |
15 | | - "RemoteMwTimedText" : "remotes/RemoteMwTimedText.js" |
16 | | - } ); |
17 | | - |
18 | | - // Merge in timed text related attributes: TODO add merge config support with some way to |
19 | | - // clasify configuration as "default" vs custom. |
20 | | - var sourceAttr = mw.getConfig( 'EmbedPlayer.SourceAttributes'); |
21 | | - mw.setConfig( 'EmbedPlayer.SourceAttributes', $j.extend( sourceAttr, [ |
22 | | - 'srclang', |
23 | | - 'category' |
24 | | - ]) ); |
25 | | - |
26 | | - mw.setDefaultConfig( { |
27 | | - // If the Timed Text interface should be displayed: |
28 | | - // 'always' Displays link and call to contribute always |
29 | | - // 'auto' Looks for child timed text elements or "apiTitleKey" & load interface |
30 | | - // 'off' Does not display the timed text interface |
31 | | - "TimedText.showInterface" : "auto", |
32 | | - |
33 | | - /** |
34 | | - * If the "add timed text" link / interface should be exposed |
35 | | - */ |
36 | | - 'TimedText.showAddTextLink' : true, |
37 | | - |
38 | | - // The category for listing videos that need transcription: |
39 | | - 'TimedText.NeedsTranscriptCategory' : 'Videos needing subtitles' |
40 | | - }); |
41 | | - |
42 | | - var mwTimedTextRequestSet = [ |
43 | | - '$j.fn.menu', |
44 | | - 'mw.TimedText', |
45 | | - 'mw.style.TimedText', |
46 | | - 'mw.style.jquerymenu' |
47 | | - ]; |
48 | | - |
49 | | - // TimedText module |
50 | | - mw.addModuleLoader( 'TimedText', mwTimedTextRequestSet ); |
51 | | - |
52 | | - /** |
53 | | - * Setup the load embedPlayer visit tag addSetupHook function |
54 | | - * |
55 | | - * Check if the video tags in the page support timed text |
56 | | - * this way we can add our timed text libraries to the player |
57 | | - * library request. |
58 | | - */ |
59 | | - |
60 | | - // Update the player loader request with timedText library if the embedPlayer |
61 | | - // includes timedText tracks. |
62 | | - $( mw ).bind( 'EmbedPlayerUpdateDependencies', function( event, playerElement, classRequest ) { |
63 | | - if( mw.isTimedTextSupported( playerElement ) ) { |
64 | | - classRequest = $j.merge( classRequest, mwTimedTextRequestSet ); |
65 | | - } |
66 | | - } ); |
67 | | - |
68 | | - // On new embed player check if we need to add timedText |
69 | | - $( mw ).bind( 'EmbedPlayerNewPlayer', function( event, embedPlayer ){ |
70 | | - if( mw.isTimedTextSupported( embedPlayer) ){ |
71 | | - if( ! embedPlayer.timedText && mw.TimedText ) { |
72 | | - embedPlayer.timedText = new mw.TimedText( embedPlayer ); |
73 | | - } |
74 | | - } |
75 | | - }); |
76 | | - |
77 | | - /** |
78 | | - * Check if we should load the timedText interface or not. |
79 | | - * |
80 | | - * Note we check for text sources outside of |
81 | | - */ |
82 | | - mw.isTimedTextSupported = function( embedPlayer ) { |
83 | | - if( mw.getConfig( 'TimedText.showInterface' ) == 'always' ) { |
84 | | - return true; |
85 | | - } |
86 | | - // Check for timed text sources or api/ roe url |
87 | | - if ( |
88 | | - ( |
89 | | - $( embedPlayer ).attr('apititlekey') |
90 | | - || |
91 | | - $( embedPlayer ).attr('apiTitleKey' ) |
92 | | - ) |
93 | | - || |
94 | | - ( embedPlayer.mediaElement && embedPlayer.mediaElement.textSourceExists() ) |
95 | | - || |
96 | | - $( embedPlayer ).find( 'track' ).length != 0 |
97 | | - ) { |
98 | | - return true; |
99 | | - } else { |
100 | | - return false; |
101 | | - } |
102 | | - }; |
103 | | - |
104 | | - // TimedText editor: |
105 | | - mw.addModuleLoader( 'TimedText.Edit', [ |
106 | | - [ |
107 | | - '$j.ui', |
108 | | - '$j.widget', |
109 | | - '$j.ui.mouse', |
110 | | - '$j.ui.position', |
111 | | - '$j.fn.menu', |
112 | | - "mw.style.jquerymenu", |
113 | | - |
114 | | - 'mw.TimedText', |
115 | | - 'mw.style.TimedText', |
116 | | - |
117 | | - 'mw.TimedTextEdit', |
118 | | - 'mw.style.TimedTextEdit' |
119 | | - ], |
120 | | - [ |
121 | | - '$j.ui.dialog', |
122 | | - '$j.ui.tabs' |
123 | | - ] |
124 | | - ]); |
125 | | - |
126 | | -} )( window.mediaWiki, window.jQuery ); |
\ No newline at end of file |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/TimedText/TimedText.config.php |
— | — | @@ -0,0 +1,21 @@ |
| 2 | +<?php |
| 3 | + /** |
| 4 | + * Do not edit this file instead use LocalSettings.php and |
| 5 | + * $wgMwEmbedModuleConfig[ {configuration name} ] = value; format |
| 6 | + */ |
| 7 | + |
| 8 | + return array( |
| 9 | + // If the Timed Text interface should be displayed: |
| 10 | + // 'always' Displays link and call to contribute always |
| 11 | + // 'auto' Looks for child timed text elements or "apiTitleKey" & load interface |
| 12 | + // 'off' Does not display the timed text interface |
| 13 | + "TimedText.ShowInterface" => "auto", |
| 14 | + |
| 15 | + /** |
| 16 | + * If the "add timed text" link / interface should be exposed |
| 17 | + */ |
| 18 | + 'TimedText.showAddTextLink' => true, |
| 19 | + |
| 20 | + // The category for listing videos that need transcription: |
| 21 | + 'TimedText.NeedsTranscriptCategory' => 'Videos needing subtitles' |
| 22 | + ); |
\ No newline at end of file |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/TimedText/mw.TimedText.js |
— | — | @@ -11,10 +11,8 @@ |
12 | 12 | * |
13 | 13 | */ |
14 | 14 | |
15 | | -mw.includeAllModuleMessages(); |
16 | | - |
17 | 15 | // Bind to mw ( for uncluttered global namespace ) |
18 | | -( function( $ ) { |
| 16 | +( function( mw, $ ) { |
19 | 17 | |
20 | 18 | /** |
21 | 19 | * Timed Text Object |
— | — | @@ -23,6 +21,7 @@ |
24 | 22 | mw.TimedText = function( embedPlayer, options ) { |
25 | 23 | return this.init( embedPlayer, options); |
26 | 24 | }; |
| 25 | + |
27 | 26 | mw.TimedText.prototype = { |
28 | 27 | |
29 | 28 | /** |
— | — | @@ -162,7 +161,7 @@ |
163 | 162 | }) ).css({ |
164 | 163 | // Get the text size scale then set it to control bar height + 10 px; |
165 | 164 | 'bottom': ( _this.embedPlayer.controlBuilder.getHeight() + textOffset ) + 'px' |
166 | | - }) |
| 165 | + }); |
167 | 166 | |
168 | 167 | }); |
169 | 168 | |
— | — | @@ -225,7 +224,7 @@ |
226 | 225 | return $textButton; |
227 | 226 | |
228 | 227 | } |
229 | | - } |
| 228 | + }; |
230 | 229 | }, |
231 | 230 | |
232 | 231 | bindTextButton: function($textButton){ |
— | — | @@ -644,7 +643,7 @@ |
645 | 644 | } |
646 | 645 | |
647 | 646 | // Put in the "Make Transcript" link if config enabled and we have an api key |
648 | | - if( mw.getConfig( 'TimedText.showAddTextLink' ) && _this.embedPlayer.apiTitleKey ){ |
| 647 | + if( mw.getConfig( 'TimedText.ShowAddTextLink' ) && _this.embedPlayer.apiTitleKey ){ |
649 | 648 | $menu.append( |
650 | 649 | _this.getLiAddText() |
651 | 650 | ); |
— | — | @@ -1625,13 +1624,6 @@ |
1626 | 1625 | } |
1627 | 1626 | }; |
1628 | 1627 | |
1629 | | - |
1630 | | -} )( window.mw ); |
1631 | | - |
1632 | | -/** |
1633 | | -* jQuery entry point for timedText interface: |
1634 | | -*/ |
1635 | | -( function( $ ) { |
1636 | 1628 | /** |
1637 | 1629 | * jquery timedText binding. |
1638 | 1630 | * Calls mw.timedText on the given selector |
— | — | @@ -1645,15 +1637,15 @@ |
1646 | 1638 | } |
1647 | 1639 | if( typeof options == 'undefined' ) |
1648 | 1640 | options = {}; |
1649 | | - |
| 1641 | + |
1650 | 1642 | $( this.selector ).each(function() { |
1651 | 1643 | var embedPlayer = $(this).get(0); |
1652 | | - |
| 1644 | + |
1653 | 1645 | // Setup timed text for the given player: |
1654 | 1646 | if( ! embedPlayer.timedText ) { |
1655 | 1647 | embedPlayer.timedText = new mw.TimedText( embedPlayer, options); |
1656 | 1648 | } |
1657 | | - |
| 1649 | + |
1658 | 1650 | // Show the timedText menu |
1659 | 1651 | if( action == 'showMenu' ) { |
1660 | 1652 | // Bind the menu to the target with autoShow = true |
— | — | @@ -1661,5 +1653,6 @@ |
1662 | 1654 | embedPlayer.timedText.bindMenu( target, true ); |
1663 | 1655 | } |
1664 | 1656 | } ); |
1665 | | - } |
1666 | | -} )( jQuery ); |
| 1657 | + }; |
| 1658 | + |
| 1659 | +} )( window.mediaWiki, window.jQuery ); |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/TimedText/TimedText.loader.js |
— | — | @@ -0,0 +1,63 @@ |
| 2 | +/** |
| 3 | +* TimedText loader. |
| 4 | +*/ |
| 5 | +// Scope everything in "mw" ( keeps the global namespace clean ) |
| 6 | +( function( mw, $ ) { |
| 7 | + debugger; |
| 8 | + // Merge in timed text related attributes: |
| 9 | + mw.mergeConfig( 'EmbedPlayer.SourceAttributes', [ |
| 10 | + 'srclang', |
| 11 | + 'category' |
| 12 | + ]); |
| 13 | + |
| 14 | + /** |
| 15 | + * Check if the video tags in the page support timed text |
| 16 | + * this way we can add our timed text libraries to the player |
| 17 | + * library request. |
| 18 | + */ |
| 19 | + |
| 20 | + // Update the player loader request with timedText library if the embedPlayer |
| 21 | + // includes timedText tracks. |
| 22 | + $( mw ).bind( 'EmbedPlayerUpdateDependencies', function( event, playerElement, classRequest ) { |
| 23 | + if( mw.isTimedTextSupported( playerElement ) ) { |
| 24 | + classRequest = $j.merge( classRequest, ['mw.TimedText'] ); |
| 25 | + } |
| 26 | + } ); |
| 27 | + |
| 28 | + // On new embed player check if we need to add timedText |
| 29 | + $( mw ).bind( 'EmbedPlayerNewPlayer', function( event, embedPlayer ){ |
| 30 | + if( mw.isTimedTextSupported( embedPlayer) ){ |
| 31 | + if( ! embedPlayer.timedText && mw.TimedText ) { |
| 32 | + embedPlayer.timedText = new mw.TimedText( embedPlayer ); |
| 33 | + } |
| 34 | + } |
| 35 | + }); |
| 36 | + |
| 37 | + /** |
| 38 | + * Check if we should load the timedText interface or not. |
| 39 | + * |
| 40 | + * Note we check for text sources outside of |
| 41 | + */ |
| 42 | + mw.isTimedTextSupported = function( embedPlayer ) { |
| 43 | + if( mw.getConfig( 'TimedText.ShowInterface' ) == 'always' ) { |
| 44 | + return true; |
| 45 | + } |
| 46 | + // Check for timed text sources or api |
| 47 | + if ( |
| 48 | + ( |
| 49 | + $( embedPlayer ).attr('apititlekey') |
| 50 | + || |
| 51 | + $( embedPlayer ).attr('apiTitleKey' ) |
| 52 | + ) |
| 53 | + || |
| 54 | + ( embedPlayer.mediaElement && embedPlayer.mediaElement.textSourceExists() ) |
| 55 | + || |
| 56 | + $( embedPlayer ).find( 'track' ).length != 0 |
| 57 | + ) { |
| 58 | + return true; |
| 59 | + } else { |
| 60 | + return false; |
| 61 | + } |
| 62 | + }; |
| 63 | + |
| 64 | +} )( window.mediaWiki, window.jQuery ); |
\ No newline at end of file |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/TimedText/TimedText.php |
— | — | @@ -0,0 +1,24 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | + // Register all the timedText modules |
| 5 | + return array( |
| 6 | + "mw.TimedText" => array( |
| 7 | + 'scripts' => "mw.TimedText.js", |
| 8 | + 'styles' => "css/mw.style.TimedText.css", |
| 9 | + 'dependencies' => array( |
| 10 | + 'mw.EmbedPlayer' |
| 11 | + ) |
| 12 | + ), |
| 13 | + "mw.TimedTextEdit" => array( |
| 14 | + 'scripts' => "mw.TimedTextEdit.js", |
| 15 | + 'styles' => "css/mw.style.TimedTextEdit.css", |
| 16 | + 'dependencies' => array( |
| 17 | + 'mw.TimedText', |
| 18 | + 'jquery.ui.dialog', |
| 19 | + 'jquery.ui.tabs' |
| 20 | + ) |
| 21 | + ), |
| 22 | + "RemoteMwTimedText" =>array( |
| 23 | + 'scripts' => "remotes/RemoteMwTimedText.js" |
| 24 | + ) |
| 25 | + ); |
\ No newline at end of file |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/MwEmbedSupport/mwEmbedSupport.js |
— | — | @@ -126,8 +126,7 @@ |
127 | 127 | mw.setConfig( name, $.extend( mediaWiki.config.get( name ), value ) ); |
128 | 128 | } |
129 | 129 | }; |
130 | | - |
131 | | - |
| 130 | + |
132 | 131 | /** |
133 | 132 | * gM ( get Message ) in js2 conflated jQuery return type with string return type |
134 | 133 | * Do a legacy check for input parameters and 'do the right thing' |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/remotes/mediaWiki.js |
— | — | @@ -105,7 +105,7 @@ |
106 | 106 | // No subtitle editor ( cross domain issues ) |
107 | 107 | mw.setConfig( 'MiroSubs.EnableUniversalSubsEditor', false ); |
108 | 108 | // No subtile upload either ( for now ) |
109 | | - mw.setConfig( 'TimedText.showAddTextLink', false ); |
| 109 | + mw.setConfig( 'TimedText.ShowAddTextLink', false ); |
110 | 110 | } |
111 | 111 | |
112 | 112 | |