Index: branches/js2-work/phase3/js/mwEmbed/tests/testLang.html |
— | — | @@ -8,11 +8,12 @@ |
9 | 9 | } |
10 | 10 | </style> |
11 | 11 | <script type="text/javascript" > |
12 | | -//for just setting one or two to test at a time for debug |
13 | | -//var langKeyDebug = [ 'lt' ]; //pl |
14 | | -var langKeyDebug = mw.getConfig( 'languageCodeList' ); |
15 | 12 | |
16 | 13 | mw.ready( function(){ |
| 14 | + //for just setting one or two to test at a time for debug |
| 15 | + //var langTestSet = [ 'lt' ]; //pl |
| 16 | + var langTestSet = mw.getConfig( 'languageCodeList' ); |
| 17 | + |
17 | 18 | //do mauall script loaders calls to test multiple languages: |
18 | 19 | function doLangTable( langSet ){ |
19 | 20 | //build table output: |
— | — | @@ -34,11 +35,12 @@ |
35 | 36 | * proccess a language key test set |
36 | 37 | */ |
37 | 38 | function doProcLangKey( langKey ){ |
| 39 | + mw.log(" doProcLangKey: " + langKey ); |
38 | 40 | // Clear out the old digitTransformTable |
39 | 41 | mw.lang.digitTransformTable = null; |
40 | 42 | //Load the current language js file |
41 | 43 | var langName = 'Language' + langKey.substr(0,1).toUpperCase() + langKey.substr( 1,langKey.length ); |
42 | | - $j.getScript( '../includes/languages/classes/' + langName + '.js' , function(){ |
| 44 | + $j.getScript( '../languages/classes/' + langName + '.js' , function(){ |
43 | 45 | // Get the current language mw.testLang js |
44 | 46 | $j.getScript( '../../../mwScriptLoader.php?class=mw.testLang&debug=true&uselang='+langKey, function(){ |
45 | 47 | var o=''; |
— | — | @@ -133,10 +135,11 @@ |
134 | 136 | }); |
135 | 137 | }); |
136 | 138 | }//procc lang key: |
| 139 | + |
137 | 140 | doProcLangKey( langSet.pop() ); |
138 | 141 | } |
139 | 142 | //by default run the "debug" set: |
140 | | - doLangTable( langKeyDebug ); |
| 143 | + doLangTable( langTestSet ); |
141 | 144 | }); |
142 | 145 | |
143 | 146 | </script> |
Index: branches/js2-work/phase3/js/mwEmbed/tests/Player_Themable.html |
— | — | @@ -12,8 +12,7 @@ |
13 | 13 | <script type="text/javascript" src="../mwEmbed.js?debug=true"></script> |
14 | 14 | |
15 | 15 | --> |
16 | | - |
17 | | -<script type="text/javascript" src="../jsScriptLoader.php?debug=true&class=mwEmbed"></script> |
| 16 | + <script type="text/javascript" src="../jsScriptLoader.php?debug=true&class=mwEmbed"></script> |
18 | 17 | |
19 | 18 | </head> |
20 | 19 | <script type="text/javascript"> |
— | — | @@ -32,7 +31,7 @@ |
33 | 32 | durationHint="60" > |
34 | 33 | </video> |
35 | 34 | |
36 | | -<!-- |
| 35 | + |
37 | 36 | <video |
38 | 37 | style="width:208px;height:160px;float:left" |
39 | 38 | src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg" |
— | — | @@ -70,8 +69,8 @@ |
71 | 70 | <textarea cols="50" rows="7"><video class="kskin" style="width:400px;height:288px" poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg" |
72 | 71 | src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"></video></textarea> |
73 | 72 | </div> |
74 | | - --> |
75 | 73 | |
| 74 | + |
76 | 75 | </body> |
77 | 76 | </html> |
78 | 77 | |
Index: branches/js2-work/phase3/js/mwEmbed/skins/kskin/EmbedPlayer.css |
— | — | @@ -164,7 +164,6 @@ |
165 | 165 | float: left; |
166 | 166 | font-size: 11px; |
167 | 167 | padding: 13px 10px 15px 15px; |
168 | | - width: 320px; |
169 | 168 | } |
170 | 169 | |
171 | 170 | .k-player ul.k-menu-bar { |
— | — | @@ -181,13 +180,11 @@ |
182 | 181 | .k-player .k-menu { |
183 | 182 | background: none repeat scroll 0 0 #181818; |
184 | 183 | border: medium none; |
185 | | - display: none; |
186 | | - height: 300px; |
| 184 | + display: none; |
187 | 185 | left: 0; |
188 | 186 | opacity: 0.9; |
189 | 187 | position: absolute; |
190 | | - top: 0; |
191 | | - width: 400px; |
| 188 | + top: 0; |
192 | 189 | z-index: 999; |
193 | 190 | } |
194 | 191 | |
— | — | @@ -396,7 +393,7 @@ |
397 | 394 | bottom:30px; |
398 | 395 | left:15px; |
399 | 396 | position:absolute; |
400 | | - right:61px; |
| 397 | + right:30px; |
401 | 398 | top:48px; |
402 | 399 | } |
403 | 400 | .k-player .credits_box a{ |
— | — | @@ -411,7 +408,7 @@ |
412 | 409 | .k-player .k-attribution{ |
413 | 410 | position:absolute; |
414 | 411 | bottom: 15px; |
415 | | - right : 62px; |
| 412 | + right : 30px; |
416 | 413 | background: url("images/kaltura_open_source_video_platform.png"); |
417 | 414 | width : 51px; |
418 | 415 | height : 12px; |
Index: branches/js2-work/phase3/js/mwEmbed/skins/kskin/kskinConfig.js |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | /** |
3 | | -* skin js allows you to override contrlBuilder html/class output |
| 3 | +* Skin js allows you to override contrlBuilder html/class output |
4 | 4 | */ |
5 | 5 | |
6 | 6 | mw.addMessages( { |
— | — | @@ -14,8 +14,8 @@ |
15 | 15 | // Display time string length |
16 | 16 | longTimeDisp: false, |
17 | 17 | |
18 | | - // Options are handled internally |
19 | | - external_options: false, |
| 18 | + // Default control bar height |
| 19 | + height: 20, |
20 | 20 | |
21 | 21 | // Volume control layout is horizontal |
22 | 22 | volume_layout: 'horizontal', |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | ) |
45 | 45 | } |
46 | 46 | }, |
47 | | - 'volumeControl':{ |
| 47 | + 'volumeControl': { |
48 | 48 | 'w':40 |
49 | 49 | }, |
50 | 50 | // No kalturaAttribution component for kSkin ( its integrated into the credits screen ) |
— | — | @@ -62,15 +62,23 @@ |
63 | 63 | $menuOverlay = $j( '<div />') |
64 | 64 | .addClass( 'k-menu ui-widget-content' ) |
65 | 65 | .css( { |
66 | | - 'width' : ctrlObj.getOverlayWidth(), |
67 | | - 'height' : ctrlObj.getOverlayHeight() |
| 66 | + 'width' : '100%', |
| 67 | + 'position': 'absolute', |
| 68 | + 'top' : '0px' |
68 | 69 | } ); |
| 70 | + |
| 71 | + if( ctrlObj.checkOverlayControls() ){ |
| 72 | + // Set to overlayheight - ( control bar height + 2 for borders ) |
| 73 | + $menuOverlay.css( 'bottom', ctrlObj.getHeight() + 2 ); |
| 74 | + }else{ |
| 75 | + $menuOverlay.css( 'bottom', 0 ); |
| 76 | + } |
69 | 77 | |
70 | 78 | // Setup menu offset ( if player height < getOverlayHeight ) |
71 | 79 | // This displays the menu outside of the player on small embeds |
72 | 80 | if ( embedPlayer.getPlayerHeight() < ctrlObj.getOverlayHeight() ) { |
73 | 81 | |
74 | | - $menuOverlay.css( 'top', parseInt( embedPlayer.getPlayerHeight() + ctrlObj.getControlBarHeight() ) + 'px' ); |
| 82 | + $menuOverlay.css( 'top', parseInt( embedPlayer.getPlayerHeight() + ctrlObj.getHeight() ) + 'px' ); |
75 | 83 | |
76 | 84 | // Special common overflow hack for thumbnail display of player |
77 | 85 | $j( embedPlayer ).parents( '.thumbinner' ).css( 'overflow', 'visible' ); |
— | — | @@ -101,8 +109,11 @@ |
102 | 110 | var $menuScreens = $j( '<div />' ) |
103 | 111 | .addClass( 'k-menu-screens' ) |
104 | 112 | .css( { |
105 | | - 'width' : ( ctrlObj.getOverlayWidth() - 75 ), |
106 | | - 'height' : ( ctrlObj.getOverlayHeight() - ctrlObj.getControlBarHeight() ) |
| 113 | + 'position' : 'absolute', |
| 114 | + 'top' : '0px', |
| 115 | + 'left' : '0px', |
| 116 | + 'bottom' : '0px', |
| 117 | + 'right' : '45px', |
107 | 118 | } ) |
108 | 119 | for ( var menuItem in ctrlObj.supportedMenuItems ) { |
109 | 120 | $menuScreens.append( |
— | — | @@ -150,10 +161,9 @@ |
151 | 162 | this.$playerTarget.find( '.k-options' ) |
152 | 163 | .unbind() |
153 | 164 | .click( function() { |
154 | | - if ( _this.$playerTarget.find( '.k-menu' ).length == 0 ) { |
155 | | - |
| 165 | + if ( _this.$playerTarget.find( '.k-menu' ).length == 0 ) { |
156 | 166 | // Stop the player if it does not support overlays: |
157 | | - if ( !embedPlayer.supports['overlays'] ){ |
| 167 | + if ( !embedPlayer.supports['overlays'] ) { |
158 | 168 | embedPlayer.stop(); |
159 | 169 | } |
160 | 170 | |
Index: branches/js2-work/phase3/js/mwEmbed/skins/ctrlBuilder.js |
— | — | @@ -22,14 +22,11 @@ |
23 | 23 | // Long string display of time value |
24 | 24 | longTimeDisp: true, |
25 | 25 | |
26 | | - // If the options menu outside of player |
27 | | - external_options : true, |
28 | | - |
29 | 26 | // Default volume layout is "vertical" |
30 | 27 | volume_layout : 'vertical', |
31 | 28 | |
32 | | - // Default control bar height is 33 |
33 | | - height: 33, |
| 29 | + // Default control bar height |
| 30 | + height: 31, |
34 | 31 | |
35 | 32 | // Default supported components is merged with embedPlayer set of supported types |
36 | 33 | supportedComponets: { |
— | — | @@ -51,7 +48,7 @@ |
52 | 49 | |
53 | 50 | // Flag to store the current fullscreen mode |
54 | 51 | fullscreenMode: false, |
55 | | - |
| 52 | + |
56 | 53 | /** |
57 | 54 | * Initialization Object for the control builder |
58 | 55 | * |
— | — | @@ -74,6 +71,14 @@ |
75 | 72 | }, |
76 | 73 | |
77 | 74 | /** |
| 75 | + * Get the control bar height |
| 76 | + * @return {Number} control bar height |
| 77 | + */ |
| 78 | + getHeight: function(){ |
| 79 | + return this.height; |
| 80 | + }, |
| 81 | + |
| 82 | + /** |
78 | 83 | * Get the controls html |
79 | 84 | * @return {String} html output of controls |
80 | 85 | */ |
— | — | @@ -86,18 +91,37 @@ |
87 | 92 | |
88 | 93 | // Remove any old controls: |
89 | 94 | embedPlayer.$interface.find( '.control-bar' ).remove(); |
90 | | - |
91 | | - // Add some space to control_wrap for the control bar: |
92 | | - embedPlayer.$interface.css( { |
93 | | - 'height' : parseInt( embedPlayer.height ) + parseInt( this.height) |
94 | | - } ); |
95 | | - embedPlayer.$interface.append( |
96 | | - $j('<div>') |
| 95 | + |
| 96 | + // Setup the controlBar container |
| 97 | + var $controlBar = $j('<div>') |
97 | 98 | .addClass( 'ui-state-default ui-widget-header ui-helper-clearfix control-bar' ) |
98 | | - .css('display', 'block') |
99 | | - ); |
| 99 | + .css( 'height', this.height ) |
| 100 | + |
| 101 | + // Check for overlay controls: |
| 102 | + if( _this.checkOverlayControls() ){ |
| 103 | + $controlBar.css({ |
| 104 | + 'position': 'absolute', |
| 105 | + 'bottom' : '0px', |
| 106 | + 'left' : '0px', |
| 107 | + 'right' : '0px' |
| 108 | + }) |
| 109 | + .hide() |
| 110 | + // Make sure the interface is correct height: |
| 111 | + embedPlayer.$interface.css( { |
| 112 | + 'height' : parseInt( embedPlayer.height ) |
| 113 | + } ); |
| 114 | + } else { |
| 115 | + // Add some space to interface for the control bar ( if not overlaying controls ) |
| 116 | + embedPlayer.$interface.css( { |
| 117 | + 'height' : parseInt( embedPlayer.height ) + parseInt( this.height ) |
| 118 | + } ); |
| 119 | + // update the control bar display to "block" |
| 120 | + $controlBar.css('display', 'block') |
| 121 | + } |
| 122 | + // add the controls to the interface |
| 123 | + embedPlayer.$interface.append( $controlBar ); |
100 | 124 | |
101 | | - //Add the Controls with their bindings |
| 125 | + // Add the Controls with their bindings |
102 | 126 | this.addControlComponents(); |
103 | 127 | |
104 | 128 | // Add hooks once Controls are in DOM |
— | — | @@ -149,7 +173,7 @@ |
150 | 174 | continue; |
151 | 175 | } |
152 | 176 | |
153 | | - // For now skip "fullscreen" for "audio" assets or where height is 0px |
| 177 | + // Skip "fullscreen" button for assets or where height is 0px ( audio ) |
154 | 178 | if( component_id == 'fullscreen' && this.embedPlayer.height == 0 ){ |
155 | 179 | continue; |
156 | 180 | } |
— | — | @@ -169,18 +193,70 @@ |
170 | 194 | } |
171 | 195 | } |
172 | 196 | }, |
| 197 | + |
173 | 198 | /** |
| 199 | + * Get the fullscreen player css |
| 200 | + */ |
| 201 | + getFullscreenPlayerCss: function(){ |
| 202 | + var embedPlayer = this.embedPlayer; |
| 203 | + // Setup target height width based on max window size |
| 204 | + var fullWidth = $j( window ).width() - 2 ; |
| 205 | + var fullHeight = $j( window ).height() ; |
| 206 | + |
| 207 | + // Set target width |
| 208 | + targetWidth = fullWidth; |
| 209 | + targetHeight = targetWidth * ( embedPlayer.getHeight() / embedPlayer.getWidth() ) |
| 210 | + // Check if it exceeds the height constraint: |
| 211 | + if( targetHeight > fullHeight ){ |
| 212 | + targetHeight = fullHeight; |
| 213 | + targetWidth = targetHeight * ( embedPlayer.getWidth() / embedPlayer.getHeight() ); |
| 214 | + } |
| 215 | + var offsetTop = ( targetHeight < fullHeight )? ( fullHeight- targetHeight ) / 2 : 0; |
| 216 | + var offsetLeft = ( targetWidth < fullWidth )? ( fullWidth- targetWidth ) / 2 : 0; |
| 217 | + //mw.log(" targetWidth: " + targetWidth + ' fullwidth: ' + fullWidth + ' :: ' + ( fullWidth- targetWidth ) / 2 ); |
| 218 | + return { |
| 219 | + 'height': targetHeight, |
| 220 | + 'width' : targetWidth, |
| 221 | + 'top' : offsetTop, |
| 222 | + 'left' : offsetLeft |
| 223 | + } |
| 224 | + }, |
| 225 | + |
| 226 | + /** |
| 227 | + * Get the fullscreen play button css |
| 228 | + */ |
| 229 | + getFullscreenPlayButtonCss: function(){ |
| 230 | + var pos = this.getFullscreenPlayerCss(); |
| 231 | + return { |
| 232 | + 'left' : ( ( pos.width - this.getComponentWidth( 'playButtonLarge' ) ) / 2 ), |
| 233 | + 'top' : ( ( pos.height - this.getComponentHeight( 'playButtonLarge' ) ) / 2 ) |
| 234 | + } |
| 235 | + }, |
| 236 | + |
| 237 | + /** |
| 238 | + * Get the fullscreen text css |
| 239 | + */ |
| 240 | + getFullscreenTextCss: function(){ |
| 241 | + // Some arbitrary scale relative to window size |
| 242 | + var textSize = ( $j( window ).width() / 8 ) + 20; |
| 243 | + if( textSize < 95 ) textSize = 95; |
| 244 | + if( textSize > 250 ) textSize = 250; |
| 245 | + mw.log(' win size is: ' + $j( window ).width() + ' ts: ' + textSize ); |
| 246 | + return { |
| 247 | + 'font-size' : textSize + '%' |
| 248 | + } |
| 249 | + }, |
| 250 | + |
| 251 | + /** |
174 | 252 | * Toggles full screen by calling |
175 | 253 | * doFullScreenPlayer to enable fullscreen mode |
176 | | - * restoreWindowPlayer to restor window mode |
| 254 | + * restoreWindowPlayer to restore window mode |
177 | 255 | */ |
178 | 256 | toggleFullscreen: function(){ |
179 | 257 | if( this.fullscreenMode ){ |
180 | | - this.restoreWindowPlayer(); |
181 | | - this.fullscreenMode = false; |
| 258 | + this.restoreWindowPlayer(); |
182 | 259 | }else{ |
183 | 260 | this.doFullScreenPlayer(); |
184 | | - this.fullscreenMode = true; |
185 | 261 | } |
186 | 262 | }, |
187 | 263 | |
— | — | @@ -188,126 +264,175 @@ |
189 | 265 | * Do full-screen mode |
190 | 266 | */ |
191 | 267 | doFullScreenPlayer: function(){ |
192 | | - mw.log(" ctrlBuilder :: toggle full-screen "); |
193 | | - |
| 268 | + mw.log(" ctrlBuilder :: toggle full-screen "); |
194 | 269 | // Setup pointer to control builder : |
195 | 270 | var _this = this; |
196 | 271 | |
197 | | - // Setup loadl refrence to embed player: |
| 272 | + // Setup local reference to embed player: |
198 | 273 | var embedPlayer = this.embedPlayer; |
199 | 274 | |
200 | | - // Setup a local refrence to the player interface: |
| 275 | + // Setup a local reference to the player interface: |
201 | 276 | var $interface = embedPlayer.$interface; |
202 | 277 | |
203 | | - // Add the black overlay: |
| 278 | + |
| 279 | + // Check fullscreen state ( if already true do nothing ) |
| 280 | + if( this.fullscreenMode == true ){ |
| 281 | + return ; |
| 282 | + } |
| 283 | + this.fullscreenMode = true; |
| 284 | + |
| 285 | + // Add the fullscreen black overlay: |
204 | 286 | $j( '<div />' ) |
205 | 287 | .addClass( 'mw-fullscreen-overlay' ) |
206 | 288 | // Set some arbitrary high z-index |
207 | | - .css('z-index', mw.getConfig( 'fullScreenIndex' ) ) |
| 289 | + .css('z-index', mw.getConfig( 'fullScreenIndex' ) -1) |
208 | 290 | .appendTo('body') |
209 | 291 | .hide() |
210 | 292 | .fadeIn("slow"); |
211 | 293 | |
212 | | - // Setup target height width based on max window size |
213 | | - var fullWidth = $j(window).width() - 5 ; |
214 | | - var fullHeight = $j(window).height() -5; |
| 294 | + // Set the video player margins to "auto" for centered resize |
| 295 | + /*$j( embedPlayer ).css( { |
| 296 | + 'margin' : 'auto' |
| 297 | + } );*/ |
215 | 298 | |
216 | | - // Set target width |
217 | | - targetWidth = fullWidth; |
218 | | - targetHeight = targetWidth * ( embedPlayer.height / embedPlayer.width ) |
219 | | - // Check if it exted the height constrait: |
220 | | - if( targetHeight > fullHeight ){ |
221 | | - targetHeight = fullHeight; |
222 | | - targetWidth = targetHeight * ( embedPlayer.width / embedPlayer.height ); |
223 | | - } |
224 | | - |
225 | 299 | // Change the interface to absolute positioned: |
226 | 300 | this.windowPositionStyle = $interface.css( 'position' ); |
| 301 | + this.windowZindex = $interface.css( 'z-index' ); |
| 302 | + |
227 | 303 | $interface.css( { |
228 | 304 | 'position' : 'absolute', |
229 | | - 'z-index' : mw.getConfig( 'fullScreenIndex' ) + 1 |
230 | | - } ); |
231 | | - |
| 305 | + 'z-index' : mw.getConfig( 'fullScreenIndex' ) |
| 306 | + } ); |
| 307 | + |
232 | 308 | // Get the base offset: |
233 | | - this.windowOffset = $interface.offset(); |
| 309 | + this.windowOffset = $interface.offset(); |
234 | 310 | var topOffset = '0px'; |
235 | 311 | var leftOffset = '0px'; |
| 312 | + |
236 | 313 | //Check if we have an offsetParent |
237 | | - if( $interface.offsetParent().length ){ |
| 314 | + if( $interface.offsetParent().get(0).tagName.toLowerCase() != 'body' ) { |
238 | 315 | topOffset = -this.windowOffset.top + 'px'; |
239 | 316 | leftOffset = -this.windowOffset.left + 'px'; |
240 | 317 | } |
| 318 | + // Resize interface container |
241 | 319 | $interface.animate( { |
242 | 320 | 'top' : topOffset, |
243 | 321 | 'left' : leftOffset, |
244 | | - 'width' : '99%', |
245 | | - 'height' : '99%', |
246 | | - 'z-index' : '999999' |
| 322 | + 'width' : '100%', |
| 323 | + 'height' : '100%' |
247 | 324 | } ) |
248 | 325 | |
249 | 326 | // Set the player height width: |
250 | | - $j( this.embedPlayer ).css( { |
251 | | - 'position' : 'relative', |
252 | | - 'z-index' : '999999' |
253 | | - } ) |
| 327 | + $j( embedPlayer ).css( { |
| 328 | + 'position' : 'relative' |
| 329 | + } ) |
254 | 330 | // Animate a zoom ( while keeping aspect ) |
255 | | - .animate( { |
256 | | - 'top' : '0px', |
257 | | - 'left' : '0px', |
258 | | - 'width' : targetWidth, |
259 | | - 'height' : targetHeight |
260 | | - } ) |
| 331 | + .animate( _this.getFullscreenPlayerCss() ); |
261 | 332 | |
262 | | - /* |
263 | | - -moz-transform:scale(1.97833) translate(-5px, 4px); |
264 | | - -moz-transform-origin:50.0852% 45.6621%; |
265 | | - left:0; |
266 | | - position:relative; |
267 | | - top:0; |
268 | | - */ |
269 | | - |
270 | | - // bind hide controls when mouse is not active |
| 333 | + // Resize the timed text font size per window width |
| 334 | + $interface.find( '.itext' ).animate( _this.getFullscreenTextCss() ); |
271 | 335 | |
272 | | - // bind resize reize window to resize window |
| 336 | + // Reposition play-btn-large ( this is unfortunatly not easy to position with 'margin': 'auto' |
| 337 | + $interface.find('.play-btn-large').animate( _this.getFullscreenPlayButtonCss() ) |
273 | 338 | |
274 | | - // bind escape to restore clip resolution |
| 339 | + // Bind mouse move in interface to hide control bar |
| 340 | + _this.mouseMovedFlag = false; |
| 341 | + $interface.mousemove( function(e){ |
| 342 | + _this.mouseMovedFlag = true; |
| 343 | + }); |
| 344 | + // Check every 2 seconds reset flag status: |
| 345 | + function checkMovedMouse(){ |
| 346 | + mw.log("checkMovedMouse::" + _this.mouseMovedFlag ); |
| 347 | + if( _this.fullscreenMode ){ |
| 348 | + if( _this.mouseMovedFlag ){ |
| 349 | + _this.mouseMovedFlag = false; |
| 350 | + _this.showControlBar(); |
| 351 | + // once we move the mouse keep displayed for 5 seconds |
| 352 | + setTimeout(checkMovedMouse, 5000); |
| 353 | + }else{ |
| 354 | + // Check for mouse movment every 250ms |
| 355 | + _this.hideControlBar(); |
| 356 | + setTimeout(checkMovedMouse, 250 ); |
| 357 | + } |
| 358 | + } |
| 359 | + }; |
| 360 | + checkMovedMouse(); |
| 361 | + |
| 362 | + |
| 363 | + |
| 364 | + // Bind resize resize window to resize window |
| 365 | + $j( window ).resize( function() { |
| 366 | + // Update player size |
| 367 | + $j( embedPlayer ).css( _this.getFullscreenPlayerCss() ); |
| 368 | + |
| 369 | + // Update play button pos |
| 370 | + $interface.find('.play-btn-large').css( _this.getFullscreenPlayButtonCss() ); |
| 371 | + |
| 372 | + // Update the timed text size |
| 373 | + $interface.find( '.itext' ).css( _this.getFullscreenTextCss() ); |
| 374 | + }); |
| 375 | + |
| 376 | + // Bind escape to restore clip resolution |
275 | 377 | $j( window ).keyup( function(event) { |
276 | 378 | // Escape check |
277 | 379 | if( event.keyCode == 27 ){ |
278 | 380 | _this.restoreWindowPlayer(); |
279 | 381 | } |
280 | | - } ); |
281 | | - |
282 | | - }, |
283 | | - restoreWindowPlayer: function(){ |
| 382 | + } ); |
| 383 | + }, |
| 384 | + |
| 385 | + /** |
| 386 | + * Restore the window player |
| 387 | + */ |
| 388 | + restoreWindowPlayer: function() { |
284 | 389 | var _this = this; |
285 | 390 | var embedPlayer = this.embedPlayer; |
| 391 | + |
| 392 | + // Check fullscreen state |
286 | 393 | if( this.fullscreenMode == false ){ |
287 | 394 | return ; |
288 | 395 | } |
289 | 396 | // Set fullscreen mode to false |
290 | 397 | this.fullscreenMode = false; |
291 | 398 | |
292 | | - var $interface = embedPlayer.$interface; |
| 399 | + var $interface = embedPlayer.$interface; |
| 400 | + var interfaceHeight = ( _this.checkOverlayControls() ) |
| 401 | + ? embedPlayer.getHeight() |
| 402 | + : embedPlayer.getHeight() + _this.getHeight(); |
| 403 | + |
293 | 404 | $j('.mw-fullscreen-overlay').fadeOut( 'slow' ); |
294 | 405 | $interface.animate( { |
295 | 406 | 'top' : this.windowOffset.top, |
296 | 407 | 'left' : this.windowOffset.left, |
297 | 408 | // height is embedPlayer height + ctrlBuilder height: |
298 | | - 'height': embedPlayer.height + _this.height, |
299 | | - 'width' : embedPlayer.width |
| 409 | + 'height': interfaceHeight, |
| 410 | + 'width' : embedPlayer.getWidth() |
300 | 411 | },function(){ |
| 412 | + // Restore non-absolute layout: |
301 | 413 | $interface.css( { |
302 | 414 | 'position' : _this.windowPositionStyle, |
| 415 | + 'z-index' : _this.windowZindex, |
303 | 416 | 'top' : null, |
304 | 417 | 'left' : null |
305 | 418 | } ); |
306 | 419 | } ); |
307 | | - // resize the player: |
| 420 | + // Restore the player: |
308 | 421 | $j( embedPlayer ).animate( { |
309 | | - 'width' : embedPlayer.width, |
310 | | - 'height' : embedPlayer.height |
| 422 | + 'top' : '0px', |
| 423 | + 'left' : '0px', |
| 424 | + 'width' : embedPlayer.getWidth(), |
| 425 | + 'height' : embedPlayer.getHeight() |
311 | 426 | }) |
| 427 | + // Restore the play button |
| 428 | + $interface.find('.play-btn-large').animate( { |
| 429 | + 'left' : ( ( embedPlayer.getPlayerWidth() - this.getComponentWidth( 'playButtonLarge' ) ) / 2 ), |
| 430 | + 'top' : ( ( embedPlayer.getPlayerHeight() -this.getComponentHeight( 'playButtonLarge' ) ) / 2 ) |
| 431 | + } ); |
| 432 | + |
| 433 | + // Restore text size: |
| 434 | + $interface.find('.itext').animate({ |
| 435 | + 'font-size' : '100%' |
| 436 | + }) |
312 | 437 | }, |
313 | 438 | |
314 | 439 | /** |
— | — | @@ -325,13 +450,6 @@ |
326 | 451 | }, |
327 | 452 | |
328 | 453 | /** |
329 | | - * Get the control bar height: |
330 | | - */ |
331 | | - getControlBarHeight: function( ) { |
332 | | - return this.height; |
333 | | - }, |
334 | | - |
335 | | - /** |
336 | 454 | * addControlHooks |
337 | 455 | * Adds control hooks once controls are in the DOM |
338 | 456 | */ |
— | — | @@ -341,12 +459,43 @@ |
342 | 460 | var _this = this; |
343 | 461 | |
344 | 462 | // Setup target shortcut to control-bar |
345 | | - $target = embedPlayer.$interface; |
346 | | - |
| 463 | + $target = embedPlayer.$interface; |
| 464 | + var mouseIn = false; |
| 465 | + // Add hide show bindings for control overlay (if overlay is enabled ) |
| 466 | + if( _this.checkOverlayControls() ) { |
| 467 | + // Add a special absolute overlay for hover ( to keep menu displayed |
| 468 | + $j( embedPlayer.$interface ).hover( |
| 469 | + function(){ |
| 470 | + _this.showControlBar() |
| 471 | + mouseIn = true; |
| 472 | + }, |
| 473 | + function(){ |
| 474 | + mouseIn = false; |
| 475 | + // Hide controls ( delay hide if menu is visible ) |
| 476 | + function hideCheck(){ |
| 477 | + if ( embedPlayer.$interface.find( '.overlay-win' ).length != 0 |
| 478 | + || $j('.menuPositionHelper').is(':visible' ) ) { |
| 479 | + setTimeout( hideCheck, 250 ); |
| 480 | + return ; |
| 481 | + } |
| 482 | + if( _this.checkOverlayControls() && !mouseIn ) { |
| 483 | + _this.hideControlBar(); |
| 484 | + } |
| 485 | + |
| 486 | + } |
| 487 | + // Don't remove until user is out of player for 1 second |
| 488 | + setTimeout( hideCheck, 1000 ); |
| 489 | + } |
| 490 | + ); |
| 491 | + } else { |
| 492 | + $j( embedPlayer.$interface ).unbind().show(); |
| 493 | + } |
| 494 | + |
347 | 495 | // Add recommend firefox if we have non-native playback: |
348 | 496 | if ( _this.checkNativeWarning( ) ) { |
349 | 497 | _this.doNativeWarning(); |
350 | 498 | } |
| 499 | + |
351 | 500 | // Do png fix for ie6 |
352 | 501 | if ( $j.browser.msie && $j.browser.version <= 6 ) { |
353 | 502 | $j('#' + embedPlayer.id + ' .play-btn-large' ).pngFix(); |
— | — | @@ -360,8 +509,52 @@ |
361 | 510 | } |
362 | 511 | }, |
363 | 512 | |
| 513 | + /** |
| 514 | + * Hide the control bar. |
| 515 | + */ |
| 516 | + hideControlBar : function(){ |
| 517 | + // Else hide the control bar ( if checkOverlayControls is still true ) |
| 518 | + this.embedPlayer.$interface.find( '.control-bar').fadeOut( 'slow' ); |
| 519 | + // Move down itext if present |
| 520 | + $j( '.itext' ).animate( {'bottom' : 10 } ); |
| 521 | + }, |
364 | 522 | |
365 | 523 | /** |
| 524 | + * Show the control bar |
| 525 | + */ |
| 526 | + showControlBar : function(){ |
| 527 | + // Show controls |
| 528 | + this.embedPlayer.$interface.find( '.control-bar').fadeIn( 'slow' ); |
| 529 | + // Move up itext if present |
| 530 | + $j( '.itext' ).animate( { 'bottom' : this.getHeight() + 10 } ); |
| 531 | + }, |
| 532 | + |
| 533 | + /** |
| 534 | + * Checks if the browser supports overlays and the controlsOverlay is |
| 535 | + * set to true for the player or via config |
| 536 | + */ |
| 537 | + checkOverlayControls: function(){ |
| 538 | + //if the player "supports" overlays: |
| 539 | + if( ! this.embedPlayer.supports['overlays'] ){ |
| 540 | + return false; |
| 541 | + } |
| 542 | + // If the config is false |
| 543 | + if( ! mw.getConfig( 'overlayControls' ) ){ |
| 544 | + return false; |
| 545 | + } |
| 546 | + // If disabled via the player |
| 547 | + if( ! this.embedPlayer.overlayControls ){ |
| 548 | + return false; |
| 549 | + } |
| 550 | + // don't hide controls when content "height" is 0 ( audio tags ) |
| 551 | + if( this.embedPlayer.height == 0 ){ |
| 552 | + return false; |
| 553 | + } |
| 554 | + // Past alll tests OverlayControls is true: |
| 555 | + return true; |
| 556 | + }, |
| 557 | + |
| 558 | + /** |
366 | 559 | * Check if a warning should be issued to non-native playback systems |
367 | 560 | * |
368 | 561 | * dependent on mediaElement being setup |
— | — | @@ -658,7 +851,8 @@ |
659 | 852 | $j('<div />') |
660 | 853 | .addClass( 'ui-widget-overlay' ) |
661 | 854 | .css( { |
662 | | - 'height' : this.getOverlayHeight() + 'px' |
| 855 | + 'height' : '100%', |
| 856 | + 'width' : '100%' |
663 | 857 | } ) |
664 | 858 | ); |
665 | 859 | |
— | — | @@ -979,6 +1173,7 @@ |
980 | 1174 | * Get a component height |
981 | 1175 | * |
982 | 1176 | * @param {String} component_id Component key to grab height |
| 1177 | + * @return height or false if not set |
983 | 1178 | */ |
984 | 1179 | getComponentHeight: function( component_id ) { |
985 | 1180 | if ( this.components[ component_id ] |
— | — | @@ -990,6 +1185,20 @@ |
991 | 1186 | }, |
992 | 1187 | |
993 | 1188 | /** |
| 1189 | + * Get a component width |
| 1190 | + * @param {String} component_id Component key to grab width |
| 1191 | + * @return width or false if not set |
| 1192 | + */ |
| 1193 | + getComponentWidth: function( component_id ){ |
| 1194 | + if ( this.components[ component_id ] |
| 1195 | + && this.components[ component_id ].w ) |
| 1196 | + { |
| 1197 | + return this.components[ component_id ].w |
| 1198 | + } |
| 1199 | + return false; |
| 1200 | + }, |
| 1201 | + |
| 1202 | + /** |
994 | 1203 | * Components Object |
995 | 1204 | * Take in the embedPlayer and return some html for the given component. |
996 | 1205 | * |
— | — | @@ -1069,7 +1278,8 @@ |
1070 | 1279 | .buttonHover() |
1071 | 1280 | // Options binding: |
1072 | 1281 | .menu( { |
1073 | | - 'content' : ctrlObj.getOptionsMenu(), |
| 1282 | + 'content' : ctrlObj.getOptionsMenu(), |
| 1283 | + 'zindex' : mw.getConfig( 'fullScreenIndex' ), |
1074 | 1284 | 'positionOpts': { |
1075 | 1285 | 'directionV' : 'up', |
1076 | 1286 | 'offsetY' : 32, |
— | — | @@ -1093,7 +1303,7 @@ |
1094 | 1304 | $j( '<span />' ) |
1095 | 1305 | .addClass( "ui-icon ui-icon-arrow-4-diag" ) |
1096 | 1306 | ) |
1097 | | - // Fullscreen binding: |
| 1307 | + // Fullscreen binding: |
1098 | 1308 | .buttonHover().click( function() { |
1099 | 1309 | ctrlObj.embedPlayer.fullscreen(); |
1100 | 1310 | } ); |
Index: branches/js2-work/phase3/js/mwEmbed/modules/TimedText/jquery.menu/jquery.menu.js |
— | — | @@ -96,11 +96,7 @@ |
97 | 97 | }else{ |
98 | 98 | var container = $('<div>').addClass( callerClassList ).html( options.content ); |
99 | 99 | } |
100 | | - // some custom css: |
101 | | - container.css( { |
102 | | - 'left' : '0px', |
103 | | - 'z-index': 2 |
104 | | - } ); |
| 100 | + |
105 | 101 | |
106 | 102 | this.menuOpen = false; |
107 | 103 | this.menuExists = false; |
— | — | @@ -111,6 +107,7 @@ |
112 | 108 | width: 180, // width of menu container, must be set or passed in to calculate widths of child menus |
113 | 109 | maxHeight: 180, // max height of menu (if a drilldown: height does not include breadcrumb) |
114 | 110 | targetMenuContainer: null, |
| 111 | + zindex: 2, |
115 | 112 | positionOpts: { |
116 | 113 | posX: 'left', |
117 | 114 | posY: 'bottom', |
— | — | @@ -140,6 +137,13 @@ |
141 | 138 | nextCrumbLink: 'ui-icon-carat-1-e' |
142 | 139 | }, options); |
143 | 140 | |
| 141 | + |
| 142 | + // Apply some custom css to container |
| 143 | + container.css( { |
| 144 | + 'left' : '0px', |
| 145 | + 'z-index': options.zindex |
| 146 | + } ); |
| 147 | + |
144 | 148 | var killAllMenus = function() { |
145 | 149 | $.each(allUIMenus, function(i) { |
146 | 150 | if (allUIMenus[i].menuOpen) { allUIMenus[i].kill(); }; |
— | — | @@ -549,7 +553,8 @@ |
550 | 554 | var options = options; |
551 | 555 | var xVal, yVal; |
552 | 556 | |
553 | | - var helper = $( '<div class="positionHelper">' ); |
| 557 | + var helper = $( '<div class="menuPositionHelper">' ); |
| 558 | + helper.css( 'z-index', options.zindex ); |
554 | 559 | // Hard code width height of button if unset ( crazy IE ) |
555 | 560 | if( isNaN( dims.refW ) || isNaN( dims.refH ) ) { |
556 | 561 | dims.refH = 16; |
Index: branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedText.js |
— | — | @@ -215,7 +215,7 @@ |
216 | 216 | if( this.embedPlayer.supports[ 'overlays' ] ){ |
217 | 217 | var positionOpts = { |
218 | 218 | 'directionV' : 'up', |
219 | | - 'offsetY' : 32, |
| 219 | + 'offsetY' : this.embedPlayer.ctrlBuilder.getHeight(), |
220 | 220 | 'directionH' : 'left', |
221 | 221 | 'offsetX' : -28 |
222 | 222 | }; |
— | — | @@ -228,7 +228,9 @@ |
229 | 229 | // NOTE: Button target should be an option or config |
230 | 230 | $menuButton.unbind().menu( { |
231 | 231 | 'content' : _this.getMainMenu(), |
| 232 | + 'zindex' : mw.getConfig( 'fullScreenIndex' ), |
232 | 233 | 'crumbDefaultText' : ' ', |
| 234 | + 'targetMenuContainer' : _this.menuTarget, |
233 | 235 | 'autoShow' : autoShow, |
234 | 236 | 'positionOpts' : positionOpts, |
235 | 237 | 'backLinkText' : gM( 'mwe-back-btn' ) |
— | — | @@ -786,7 +788,7 @@ |
787 | 789 | $j('<div>').addClass( 'itext' + ' ' + 'itext_' + category ) |
788 | 790 | .css( { |
789 | 791 | 'position':'absolute', |
790 | | - 'bottom': ( this.embedPlayer.ctrlBuilder.height + 10 ), |
| 792 | + 'bottom': ( this.embedPlayer.ctrlBuilder.getHeight() + 10 ), |
791 | 793 | 'width': '100%', |
792 | 794 | 'display': 'block', |
793 | 795 | 'opacity': .8, |
— | — | @@ -798,33 +800,47 @@ |
799 | 801 | }) |
800 | 802 | ) |
801 | 803 | ); |
802 | | - // Resize the interface for layoutMode == 'ontop' |
803 | | - this.embedPlayer.$interface.animate({ |
804 | | - 'height': this.embedPlayer.height + this.embedPlayer.ctrlBuilder.height |
805 | | - }) |
| 804 | + |
| 805 | + // Resize the interface for layoutMode == 'ontop' ( if not in fullscreen ) |
| 806 | + // NOTE this shoudl be a call to ctrlBuilder not handled here inline |
| 807 | + if( ! this.embedPlayer.ctrlBuilder.fullscreenMode ){ |
| 808 | + if( this.embedPlayer.ctrlBuilder.checkOverlayControls() ){ |
| 809 | + var playerHeight = this.embedPlayer.getHeight(); |
| 810 | + } else { |
| 811 | + var playerHeight = this.embedPlayer.getHeight() + this.embedPlayer.ctrlBuilder.getHeight(); |
| 812 | + } |
| 813 | + // Restore the player height |
| 814 | + this.embedPlayer.$interface.animate({ |
| 815 | + 'height': playerHeight |
| 816 | + }); |
| 817 | + } |
806 | 818 | }else if ( layoutMode == 'below') { |
| 819 | + // Set the belowBar size to 60 pxiles: |
| 820 | + var belowBarHeight = 60; |
807 | 821 | // Append before controls: |
808 | 822 | $playerTarget.find( '.control-bar' ).before( |
809 | 823 | $j('<div>').addClass( 'itext' + ' ' + 'itext_' + category ) |
810 | 824 | .css({ |
811 | | - 'display': 'block', |
812 | | - 'width': '100%', |
813 | | - 'height': '60px', |
814 | | - 'background-color':'#000', |
815 | | - 'text-align':'center', |
816 | | - 'padding-top':'5px' |
| 825 | + 'display' : 'block', |
| 826 | + 'width' : '100%', |
| 827 | + 'height' : belowBarHeight + 'px', |
| 828 | + 'background-color' : '#000', |
| 829 | + 'text-align' : 'center', |
| 830 | + 'padding-top' : '5px' |
817 | 831 | } ).append( |
818 | 832 | $j('<span>').css( { |
819 | 833 | 'color':'white' |
820 | 834 | } ) |
821 | 835 | ) |
822 | 836 | ); |
823 | | - var height = 62 + this.embedPlayer.height + this.embedPlayer.ctrlBuilder.height; |
824 | | - mw.log( 'set height:' + height ); |
825 | | - // Resize the interface for layoutMode == 'below' |
826 | | - this.embedPlayer.$interface.animate({ |
827 | | - 'height': height |
828 | | - }) |
| 837 | + // |
| 838 | + var height = belowBarHeight + this.embedPlayer.getHeight() + this.embedPlayer.ctrlBuilder.getHeight(); |
| 839 | + // Resize the interface for layoutMode == 'below' ( if not in full screen) |
| 840 | + if( ! this.embedPlayer.ctrlBuilder.fullscreenMode ){ |
| 841 | + this.embedPlayer.$interface.animate({ |
| 842 | + 'height': height |
| 843 | + }) |
| 844 | + } |
829 | 845 | mw.log( ' height of ' + this.embedPlayer.id + ' is now: ' + $j( '#' + this.embedPlayer.id ).height() ); |
830 | 846 | } |
831 | 847 | mw.log( 'should have been appended: ' + $playerTarget.find('.itext').length ); |
— | — | @@ -895,7 +911,7 @@ |
896 | 912 | var handler = parseSrt; |
897 | 913 | break; |
898 | 914 | case 'text/cmml': |
899 | | - var handler = parseCMML; |
| 915 | + var handler = parseCMML; |
900 | 916 | break; |
901 | 917 | default: |
902 | 918 | var hanlder = null; |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.RemoteSearchDriver.js |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | "rsd_results_next" : "next", |
19 | 19 | "rsd_results_prev" : "previous", |
20 | 20 | "rsd_no_results" : "No search results for <b>$1<\/b>", |
21 | | - "mwe-upload_tab" : "Upload", |
| 21 | + "mwe-upload_tab" : "Upload file", |
22 | 22 | "rsd_layout" : "Layout:", |
23 | 23 | "rsd_resource_edit" : "Edit resource: $1", |
24 | 24 | "mwe-resource_description_page" : "Resource description page", |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/kplayerEmbed.js |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | var _this = this; |
26 | 26 | var playerPath = mw.getMwEmbedPath() + 'modules/EmbedPlayer/binPlayers/kaltura-player'; |
27 | 27 | $j( this ).html( |
28 | | - '<object width="' + this.width + '" height="' + this.height + '" '+ |
| 28 | + '<object width="' + this.getWidth() + '" height="' + this.getHeight() + '" '+ |
29 | 29 | 'data="' + playerPath + '/wrapper.swf" allowfullscreen="true" '+ |
30 | 30 | 'allownetworking="all" allowscriptaccess="always" '+ |
31 | 31 | 'type="application/x-shockwave-flash" '+ |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/loader.js |
— | — | @@ -13,6 +13,10 @@ |
14 | 14 | // 'off' Does not display the timed text interface |
15 | 15 | "textInterface" : "auto", |
16 | 16 | |
| 17 | + // If the player controls should be overlayed on top of the video ( if supported by playback method) |
| 18 | + // can be set to false per embed player via overlayControls attribute |
| 19 | + 'overlayControls' : true, |
| 20 | + |
17 | 21 | // Timed Text provider presently just "commons", |
18 | 22 | // NOTE: Each player instance can also specify a provider |
19 | 23 | "timedTextProvider" : "commons", |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/genericEmbed.js |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | doEmbedHTML: function() { |
26 | 26 | $j( this ).html( |
27 | 27 | '<object type="application/ogg" ' + |
28 | | - 'width="' + this.width + '" height="' + this.height + '" ' + |
| 28 | + 'width="' + this.getWidth() + '" height="' + this.getHeight() + '" ' + |
29 | 29 | 'data="' + this.getSrc( this.seek_time_sec ) + '"></object>' |
30 | 30 | ); |
31 | 31 | } |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js |
— | — | @@ -142,6 +142,10 @@ |
143 | 143 | // The apiProvider where to lookup the title key |
144 | 144 | "apiProvider" : null, |
145 | 145 | |
| 146 | + // If the player controls should be overlayed |
| 147 | + //( Global default via config overlayControls in module loader.js) |
| 148 | + "overlayControls" : mw.getConfig( 'overlayControls' ), |
| 149 | + |
146 | 150 | // ROE url ( for xml based metadata ) |
147 | 151 | // also see: http://wiki.xiph.org/ROE |
148 | 152 | "roe" : null, |
— | — | @@ -223,7 +227,7 @@ |
224 | 228 | * Passes off request to the embedPlayer selector: |
225 | 229 | * |
226 | 230 | * @param {Object} attributes Attributes to apply to embed players |
227 | | - * @param {Function} callback Function to call once embeding is done |
| 231 | + * @param {Function} callback Function to call once embedding is done |
228 | 232 | */ |
229 | 233 | $.embedPlayers = function( attributes, callback) { |
230 | 234 | $j( mw.getConfig( 'rewritePlayerTags' ) ).embedPlayer( attributes, callback ); |
— | — | @@ -1494,7 +1498,7 @@ |
1495 | 1499 | var missing_type = this.pc.type; |
1496 | 1500 | |
1497 | 1501 | mw.log( 'No player found for given source type ' + missing_type ); |
1498 | | - $j(this).html( this.getPluginMissingHTML( missing_type ) ); |
| 1502 | + this.showPluginMissingHTML( missing_type ); |
1499 | 1503 | } |
1500 | 1504 | }, |
1501 | 1505 | |
— | — | @@ -1598,6 +1602,20 @@ |
1599 | 1603 | }, |
1600 | 1604 | |
1601 | 1605 | /** |
| 1606 | + * Get the player height |
| 1607 | + */ |
| 1608 | + getHeight: function() { |
| 1609 | + return this.height; |
| 1610 | + }, |
| 1611 | + |
| 1612 | + /** |
| 1613 | + * Get the player width |
| 1614 | + */ |
| 1615 | + getWidth: function(){ |
| 1616 | + return this.width; |
| 1617 | + }, |
| 1618 | + |
| 1619 | + /** |
1602 | 1620 | * Get the plugin embed html ( should be implemented by embed player interface ) |
1603 | 1621 | */ |
1604 | 1622 | doEmbedHTML : function() { |
— | — | @@ -1653,8 +1671,10 @@ |
1654 | 1672 | // mw.log('should embed:' + embed_code); |
1655 | 1673 | _this.doEmbedHTML() |
1656 | 1674 | }, |
| 1675 | + |
1657 | 1676 | /** |
1658 | 1677 | * Searches for related clips from titleKey |
| 1678 | + * also configuration specific ( should be in seperate file) |
1659 | 1679 | */ |
1660 | 1680 | getRelatedFromTitleKey: function() { |
1661 | 1681 | var _this = this; |
— | — | @@ -1751,7 +1771,7 @@ |
1752 | 1772 | |
1753 | 1773 | // Call the ctrlBuilder end event:: |
1754 | 1774 | |
1755 | | - //if kalturaAttribution and k-skin show the "credits" screen: |
| 1775 | + // If kalturaAttribution and k-skin show the "credits" screen: |
1756 | 1776 | if( mw.getConfig( 'kalturaAttribution' ) && this.ctrlBuilder.showCredits ) { |
1757 | 1777 | this.ctrlBuilder.showCredits(); |
1758 | 1778 | return ; |
— | — | @@ -2027,7 +2047,8 @@ |
2028 | 2048 | */ |
2029 | 2049 | showPlayer : function () { |
2030 | 2050 | mw.log( 'Show player: ' + this.id ); |
2031 | | - // set-up the local ctrlBuilder instance: |
| 2051 | + |
| 2052 | + // Set-up the local ctrlBuilder instance: |
2032 | 2053 | this.ctrlBuilder = new ctrlBuilder( this ); |
2033 | 2054 | |
2034 | 2055 | var _this = this; |
— | — | @@ -2039,23 +2060,25 @@ |
2040 | 2061 | $j('<div>') |
2041 | 2062 | .addClass('interface_wrap ' + this.ctrlBuilder.playerClass) |
2042 | 2063 | .css({ |
2043 | | - 'width': parseInt( this.width ), |
2044 | | - 'height': parseInt( this.height ), |
2045 | | - 'position': 'relative' |
| 2064 | + 'width' : parseInt( this.width ), |
| 2065 | + 'height' : parseInt( this.height ), |
| 2066 | + 'position' : 'relative', |
| 2067 | + 'overflow' : 'hidden' |
2046 | 2068 | }) |
2047 | 2069 | ) |
2048 | | - } |
| 2070 | + } |
| 2071 | + |
2049 | 2072 | //Set up local jQuery object reference to "interface_wrap" |
2050 | | - this.$interface = $j(this).parent( '.interface_wrap' ); |
| 2073 | + this.$interface = $j(this).parent( '.interface_wrap' ); |
2051 | 2074 | |
2052 | 2075 | // Update Thumbnail for the "player" |
2053 | 2076 | this.updateThumbnailHTML(); |
2054 | 2077 | |
2055 | | - // Add controls if enabled: |
| 2078 | + // Add controls if enabled: |
2056 | 2079 | if ( this.controls ) { |
2057 | | - mw.log( "embedPlayer:showPlayer::AddControls" ); |
2058 | | - this.ctrlBuilder.addControls(); |
2059 | | - } |
| 2080 | + mw.log( "embedPlayer:showPlayer::AddControls" ); |
| 2081 | + this.ctrlBuilder.addControls(); |
| 2082 | + } |
2060 | 2083 | |
2061 | 2084 | |
2062 | 2085 | if ( this.autoplay ) { |
— | — | @@ -2066,19 +2089,29 @@ |
2067 | 2090 | |
2068 | 2091 | /** |
2069 | 2092 | * Get missing plugin html (check for user included code) |
2070 | | - * @param {String} misssing_type missing type mime |
| 2093 | + * @param {String} [misssingType] missing type mime |
2071 | 2094 | */ |
2072 | | - getPluginMissingHTML : function( missing_type ) { |
2073 | | - // keep the box width hight: |
2074 | | - var out = '<div style="width:' + this.width + 'px;height:' + this.height + 'px">'; |
| 2095 | + showPluginMissingHTML : function( misssingType ) { |
| 2096 | + // Check if we have user defined missing html msg: |
2075 | 2097 | if ( this.user_missing_plugin_html ) { |
2076 | | - out += this.user_missing_plugin_html; |
| 2098 | + $j( this ).html( this.user_missing_plugin_html ); |
2077 | 2099 | } else { |
2078 | | - if ( !missing_type ) |
2079 | | - missing_type = ''; |
2080 | | - out += gM( 'mwe-generic_missing_plugin', missing_type ) + '<br><a title="' + gM( 'mwe-download_clip' ) + '" href="' + this.src + '">' + gM( 'mwe-download_clip' ) + '</a>'; |
| 2100 | + if ( !misssingType ){ |
| 2101 | + misssingType = ''; |
| 2102 | + } |
| 2103 | + $j( this ).html( |
| 2104 | + $j('<div />').append( |
| 2105 | + gM( 'mwe-generic_missing_plugin', missing_type ), |
| 2106 | + $j( '<br />' ), |
| 2107 | + $j( '<a />' ) |
| 2108 | + .attr( { |
| 2109 | + 'title' : gM( 'mwe-download_clip' ), |
| 2110 | + 'href' : this.getSrc() |
| 2111 | + }) |
| 2112 | + .text( gM( 'mwe-download_clip' ) ) |
| 2113 | + ) |
| 2114 | + ) |
2081 | 2115 | } |
2082 | | - return out + '</div>'; |
2083 | 2116 | }, |
2084 | 2117 | |
2085 | 2118 | /** |
— | — | @@ -2260,7 +2293,7 @@ |
2261 | 2294 | $j( this ).html( |
2262 | 2295 | $j( '<img />' ) |
2263 | 2296 | .css({ |
2264 | | - 'position' : 'relative', |
| 2297 | + 'position' : 'relative', |
2265 | 2298 | 'width' : '100%', |
2266 | 2299 | 'height' : '100%' |
2267 | 2300 | }) |
— | — | @@ -2361,7 +2394,7 @@ |
2362 | 2395 | }else{ |
2363 | 2396 | var loc = this.$interface.position(); |
2364 | 2397 | //Setup the menu: |
2365 | | - var playerHeight = ( parseInt( this.height ) + this.ctrlBuilder.height ); |
| 2398 | + var playerHeight = ( parseInt( this.height ) + this.ctrlBuilder.getHeight() ); |
2366 | 2399 | $j('body').append( |
2367 | 2400 | $j('<div>') |
2368 | 2401 | .addClass('ui-widget ui-widget-content ui-corner-all') |
— | — | @@ -2413,9 +2446,8 @@ |
2414 | 2447 | // check if thumbnail is being displayed and embed html |
2415 | 2448 | if ( this.thumbnail_disp ) { |
2416 | 2449 | if ( !this.selected_player ) { |
2417 | | - mw.log( 'no selected_player' ); |
2418 | | - // this.innerHTML = this.getPluginMissingHTML(); |
2419 | | - $j( '#' + this.id ).html( this.getPluginMissingHTML() ); |
| 2450 | + mw.log( 'no selected_player' ); |
| 2451 | + this.showPluginMissingHTML(); |
2420 | 2452 | } else { |
2421 | 2453 | this.doEmbedPlayer(); |
2422 | 2454 | this.paused = false; |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/javaEmbed.js |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | // load directly in the page.. |
41 | 41 | // (media must be on the same server or applet must be signed) |
42 | 42 | var appletCode = '' + |
43 | | - '<applet id="' + this.pid + '" code="com.fluendo.player.Cortado.class" archive="' + applet_loc + '" width="' + this.width + '" height="' + this.height + '"> ' + "\n" + |
| 43 | + '<applet id="' + this.pid + '" code="com.fluendo.player.Cortado.class" archive="' + applet_loc + '" width="' + this.getWidth() + '" height="' + this.getHeight() + '"> ' + "\n" + |
44 | 44 | '<param name="url" value="' + this.getSrc() + '" /> ' + "\n" + |
45 | 45 | '<param name="local" value="false"/>' + "\n" + |
46 | 46 | '<param name="keepaspect" value="true" />' + "\n" + |
— | — | @@ -55,8 +55,8 @@ |
56 | 56 | // Doesn't work in MSIE or Safari/Mac or Opera 9.5 |
57 | 57 | if ( $j.browser.mozilla ) { |
58 | 58 | var iframe = document.createElement( 'iframe' ); |
59 | | - iframe.setAttribute( 'width', this.width ); |
60 | | - iframe.setAttribute( 'height', this.height ); |
| 59 | + iframe.setAttribute( 'width', this.getWidth() ); |
| 60 | + iframe.setAttribute( 'height', this.getHeight() ); |
61 | 61 | iframe.setAttribute( 'scrolling', 'no' ); |
62 | 62 | iframe.setAttribute( 'frameborder', 0 ); |
63 | 63 | iframe.setAttribute( 'marginWidth', 0 ); |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/vlcEmbed.js |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | $j( this ).html( |
37 | 37 | '<object classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" ' + |
38 | 38 | 'codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab#Version=0,8,6,0" ' + |
39 | | - 'id="' + this.pid + '" events="True" height="' + this.height + '" width="' + this.width + '"' + |
| 39 | + 'id="' + this.pid + '" events="True" height="' + this.getHeight() + '" width="' + this.getWidth() + '"' + |
40 | 40 | '>' + |
41 | 41 | '<param name="MRL" value="">' + |
42 | 42 | '<param name="ShowDisplay" value="True">' + |
— | — | @@ -45,9 +45,9 @@ |
46 | 46 | '<param name="StartTime" value="0">' + |
47 | 47 | '<embed pluginspage="http://www.videolan.org" type="application/x-vlc-plugin" ' + |
48 | 48 | 'progid="VideoLAN.VLCPlugin.2" name="' + this.pid + '" ' + |
49 | | - 'height="' + this.height + '" width="' + this.width + '" ' + |
| 49 | + 'height="' + this.getHeight() + '" width="' + this.getWidth() + '" ' + |
50 | 50 | // set the style too 'just to be sure' |
51 | | - 'style="width:' + this.width + 'px;height:' + this.height + 'px;" ' + |
| 51 | + 'style="width:' + this.getWidth() + 'px;height:' + this.getHeight() + 'px;" ' + |
52 | 52 | '>' + |
53 | 53 | '</object>' |
54 | 54 | ) |
— | — | @@ -78,8 +78,8 @@ |
79 | 79 | this.getPlayerElement(); |
80 | 80 | if ( this.playerElement && this.playerElement.playlist) { |
81 | 81 | // manipulate the dom object to make sure vlc has the correct size: |
82 | | - this.playerElement.style.width = this.width; |
83 | | - this.playerElement.style.height = this.height; |
| 82 | + this.playerElement.style.width = this.getWidth(); |
| 83 | + this.playerElement.style.height = this.getHeight(); |
84 | 84 | this.playerElement.playlist.items.clear(); |
85 | 85 | |
86 | 86 | // VLC likes absolute urls: |