Index: branches/js2-work/phase3/js/mwEmbed/skins/ctrlBuilder.js |
— | — | @@ -610,28 +610,22 @@ |
611 | 611 | } |
612 | 612 | |
613 | 613 | // See if we have native support for ogg: |
614 | | - var supporting_players = mw.EmbedTypes.players.getMIMETypePlayers( 'video/ogg' ); |
615 | | - for ( var i = 0; i < supporting_players.length; i++ ) { |
616 | | - if ( supporting_players[i].id == 'oggNative' ) { |
| 614 | + var supportingPlayers = mw.EmbedTypes.players.getMIMETypePlayers( 'video/ogg' ); |
| 615 | + for ( var i = 0; i < supportingPlayers.length; i++ ) { |
| 616 | + if ( supportingPlayers[i].id == 'oggNative' ) { |
617 | 617 | return false; |
618 | 618 | } |
619 | 619 | } |
620 | 620 | |
621 | | - // See if we are using mwEmbed without a ogg source in which case no point in promoting firefox :P |
622 | | - if ( this.embedPlayer.mediaElement && this.embedPlayer.mediaElement.sources ) { |
623 | | - var foundOgg = false; |
624 | | - var playable_sources = this.embedPlayer.mediaElement.getPlayableSources(); |
625 | | - for ( var sInx = 0; sInx < playable_sources.length; sInx++ ) { |
626 | | - var mime_type = playable_sources[sInx].mime_type; |
627 | | - if ( mime_type == 'video/ogg' ) { |
628 | | - foundOgg = true; |
629 | | - } |
630 | | - } |
631 | | - // No ogg src... no point in download firefox link |
632 | | - if ( !foundOgg ){ |
633 | | - return false; |
634 | | - } |
| 621 | + // Check for h264 source and playback support |
| 622 | + var supportingPlayers = mw.EmbedTypes.players.getMIMETypePlayers( 'video/h264' ); |
| 623 | + var h264streams = this.embedPlayer.mediaElement.getSources( 'video/h264' ); |
| 624 | + if( supportingPlayers.length && h264streams.length ){ |
| 625 | + // No firefox link if a h.264 stream is present |
| 626 | + return false; |
635 | 627 | } |
| 628 | + |
| 629 | + // Should issue the native warning |
636 | 630 | return true; |
637 | 631 | }, |
638 | 632 | |
— | — | @@ -1050,16 +1044,16 @@ |
1051 | 1045 | if ( playable ) { |
1052 | 1046 | $playerList = $j('<ul />'); |
1053 | 1047 | // output the player select code: |
1054 | | - var supporting_players = mw.EmbedTypes.players.getMIMETypePlayers( source.getMIMEType() ); |
| 1048 | + var supportingPlayers = mw.EmbedTypes.players.getMIMETypePlayers( source.getMIMEType() ); |
1055 | 1049 | |
1056 | | - for ( var i = 0; i < supporting_players.length ; i++ ) { |
| 1050 | + for ( var i = 0; i < supportingPlayers.length ; i++ ) { |
1057 | 1051 | |
1058 | 1052 | // Add link to select the player if not already selected ) |
1059 | | - if( embedPlayer.selected_player.id == supporting_players[i].id && is_selected ) { |
| 1053 | + if( embedPlayer.selected_player.id == supportingPlayers[i].id && is_selected ) { |
1060 | 1054 | // Active player ( no link ) |
1061 | 1055 | $playerLine = $j( '<span />' ) |
1062 | 1056 | .text( |
1063 | | - supporting_players[i].getName() |
| 1057 | + supportingPlayers[i].getName() |
1064 | 1058 | ) |
1065 | 1059 | .addClass( 'ui-state-highlight ui-corner-all' ); |
1066 | 1060 | } else { |
— | — | @@ -1068,10 +1062,10 @@ |
1069 | 1063 | .attr({ |
1070 | 1064 | 'href' : '#', |
1071 | 1065 | 'rel' : 'sel_source', |
1072 | | - 'id' : 'sc_' + source_id + '_' + supporting_players[i].id |
| 1066 | + 'id' : 'sc_' + source_id + '_' + supportingPlayers[i].id |
1073 | 1067 | }) |
1074 | 1068 | .addClass( 'ui-corner-all') |
1075 | | - .text( supporting_players[i].getName() ) |
| 1069 | + .text( supportingPlayers[i].getName() ) |
1076 | 1070 | .click( function() { |
1077 | 1071 | var iparts = $j( this ).attr( 'id' ).replace(/sc_/ , '' ).split( '_' ); |
1078 | 1072 | var source_id = iparts[0]; |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.UploadHandler.js |
— | — | @@ -887,7 +887,7 @@ |
888 | 888 | $j( _this.selector ).after( |
889 | 889 | $j('<div />') |
890 | 890 | .attr({ |
891 | | - 'id' : "mw-spinner-wpDestFile", |
| 891 | + 'id' : "mw-spinner-wpDestFile" |
892 | 892 | }) |
893 | 893 | .loadingSpinner() |
894 | 894 | ); |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/searchLibs/baseRemoteSearch.js |
— | — | @@ -363,7 +363,7 @@ |
364 | 364 | .css({ |
365 | 365 | 'position' : 'relative', |
366 | 366 | 'top' : '-' + resource.crop.y, |
367 | | - 'left': '-' + resource.crop.x, |
| 367 | + 'left': '-' + resource.crop.x |
368 | 368 | }) |
369 | 369 | .append( $img ) |
370 | 370 | ) |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.UploadInterface.js |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | "mwe-upload-in-progress" : "Upload in progress (do not close this window)", |
19 | 19 | "mwe-uploaded-status" : "Uploaded", |
20 | 20 | "mwe-uploaded-time-remaining" : "Time remaining: $1", |
21 | | - "mwe-upload-done" : "Your upload <i>should be<\/i> accessible.", |
| 21 | + "mwe-upload-done" : "Your upload <i>should be<\/i> accessible." |
22 | 22 | } ); |
23 | 23 | |
24 | 24 | /** |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/kplayerEmbed.js |
— | — | @@ -22,38 +22,11 @@ |
23 | 23 | */ |
24 | 24 | doEmbedHTML : function () { |
25 | 25 | var _this = this; |
26 | | - var playerPath = mw.getMwEmbedPath() + 'modules/EmbedPlayer/binPlayers/kaltura-player'; |
| 26 | + var playerPath = mw.getMwEmbedPath() + 'modules/EmbedPlayer/binPlayers/kaltura-player'; |
27 | 27 | |
28 | | - |
29 | | - /*$j( this ).html( |
30 | | - '<object width="' + this.getWidth() + '" height="' + this.getHeight() + '" ' + |
31 | | - 'data="' + playerPath + '/wrapper.swf" allowfullscreen="true" ' + |
32 | | - 'allownetworking="all" allowscriptaccess="always" ' + |
33 | | - 'type="application/x-shockwave-flash" ' + |
34 | | - 'flashVars="kdpUrl=' + playerPath + '/kdp.swf' + |
35 | | - '&ks=dummy&partner_id=0&subp_id=0' + |
36 | | - '&uid=0&emptyF=onKdpEmpty&readyF=onKdpReady' + |
37 | | - '" '+ |
38 | | - 'wmode="opaque" ' + |
39 | | - 'id="' + this.pid + '" name="' + this.pid + '">' + |
40 | | - '<param value="always" name="allowScriptAccess"/>' + |
41 | | - '<param value="all" name="allowNetworking"/>' + |
42 | | - '<param value="true" name="allowFullScreen"/>' + |
43 | | - '<param value="#000000" name="bgcolor"/>' + |
44 | | - '<param value="wrapper.swf" name="movie"/>' + |
45 | | - '<param value="' + |
46 | | - 'kdpUrl=' + playerPath + '/kdp.swf' + |
47 | | - '&ks=dummy&partner_id=0&subp_id=0' + |
48 | | - '&uid=0&emptyF=onKdpEmpty&readyF=onKdpReady' + |
49 | | - '" ' + |
50 | | - 'name="flashVars"/>' + |
51 | | - '<param value="opaque" name="wmode"/>' + |
52 | | - '</object>' |
53 | | - )*/ |
54 | | - |
55 | 28 | var flashvars = {}; |
56 | 29 | flashvars.autoPlay = "true"; |
57 | | - flashvars.entryId = _this.getSrc(); |
| 30 | + flashvars.entryId = mw.absoluteUrl( _this.getSrc() ); |
58 | 31 | flashvars.debugMode = "true"; |
59 | 32 | flashvars.fileSystemMode = "true"; |
60 | 33 | flashvars.widgetId = "_7463"; |
— | — | @@ -62,7 +35,7 @@ |
63 | 36 | flashvars.kml = "local"; |
64 | 37 | flashvars.kmlPath = playerPath + '/config.xml'; |
65 | 38 | flashvars.sourceType = "url"; |
66 | | - flashvars.host = "www.kaltura.com"; |
| 39 | + //flashvars.host = "www.kaltura.com"; |
67 | 40 | flashvars.externalInterfaceDisabled = 'false'; |
68 | 41 | |
69 | 42 | var params = {}; |
— | — | @@ -72,16 +45,32 @@ |
73 | 46 | params.allowscriptaccess = "sameDomain"; |
74 | 47 | |
75 | 48 | var attributes = {}; |
76 | | - attributes.id = 'vid1'; |
77 | | - attributes.name = "kdp3"; |
78 | | - attributes.styleclass = "player"; |
79 | | - debugger; |
80 | | - swfobject.embedSWF( playerPath + "/kdp3.swf", "kdp3", "790", "466", "10.0.0", playerPath +"/expressInstall.swf", flashvars, params, attributes); |
| 49 | + attributes.id = this.pid; |
| 50 | + attributes.name = this.pid; |
| 51 | + attributes.styleclass = "player"; |
81 | 52 | |
82 | | - |
| 53 | + $j( this ).html( |
| 54 | + $j('<div />') |
| 55 | + .attr( 'id', this.pid + '_container' ) |
| 56 | + ); |
| 57 | + |
| 58 | + // Do the flash embeding with embedSWF |
| 59 | + swfobject.embedSWF( |
| 60 | + playerPath + "/kdp3.swf", |
| 61 | + this.pid + '_container', |
| 62 | + this.getWidth(), |
| 63 | + this.getHeight(), |
| 64 | + "10.0.0", |
| 65 | + playerPath + "/expressInstall.swf", |
| 66 | + flashvars, |
| 67 | + params, |
| 68 | + attributes |
| 69 | + ); |
| 70 | + |
83 | 71 | setTimeout(function() { |
84 | 72 | _this.postEmbedJS(); |
85 | | - }, 50); |
| 73 | + }, 250 ); |
| 74 | + |
86 | 75 | }, |
87 | 76 | |
88 | 77 | /** |
— | — | @@ -90,34 +79,22 @@ |
91 | 80 | postEmbedJS:function() { |
92 | 81 | var _this = this; |
93 | 82 | this.getPlayerElement(); |
94 | | - //alert( this.playerElement ); |
95 | | - if( this.playerElement && this.playerElement.insertMedia) { |
96 | | - // Add KDP listeners |
97 | | - |
98 | | - //this.playerElement.addJsListener("doPlay","kdpDoOnPlay"); |
99 | | - //this.playerElement.addJsListener("doStop","kdpDoOnStop"); |
100 | | - //myKdp.addJsListener("fastForward","kdpDoOnFF"); |
101 | 83 | |
| 84 | + //alert( this.playerElement ); |
| 85 | + if( this.playerElement ) { |
| 86 | + // Add KDP listeners |
102 | 87 | _this.bindPlayerFunction( 'doPause', 'onPause' ); |
103 | 88 | _this.bindPlayerFunction( 'doPlay', 'play' ); |
104 | 89 | _this.bindPlayerFunction( 'playerPlayEnd', 'onClipDone' ); |
105 | | - |
106 | | - // KDP player likes an absolute url for the src: |
107 | | - var src = mw.absoluteUrl( _this.getSrc() ); |
108 | | - mw.log('play src: ' + src); |
109 | | - |
110 | | - // Insert the src: |
111 | | - this.playerElement.insertMedia( "-1", src, 'true' ); |
112 | | - this.playerElement.dispatchKdpEvent( 'doPlay' ); |
113 | | - |
| 90 | + _this.bindPlayerFunction( 'playerUpdatePlayhead', 'onUpdatePlayhead' ); |
114 | 91 | // Start the monitor |
115 | 92 | this.monitor(); |
116 | 93 | }else{ |
117 | | - // Keep trying to get the html: |
| 94 | + // Keep trying to get the player element |
118 | 95 | //mw.log('insert media: not defiend:' + typeof this.playerElement.insertMedia ); |
119 | 96 | setTimeout( function() { |
120 | 97 | _this.postEmbedJS(); |
121 | | - }, 25); |
| 98 | + }, 250); |
122 | 99 | } |
123 | 100 | }, |
124 | 101 | |
— | — | @@ -131,7 +108,7 @@ |
132 | 109 | */ |
133 | 110 | bindPlayerFunction:function( bName, fName ) { |
134 | 111 | var cbid = fName + '_cb_' + this.id.replace(' ', '_'); |
135 | | - eval( 'window[ \'' + cbid +'\' ] = function() {$j(\'#' + this.id + '\').get(0).'+ fName +'();}' ); |
| 112 | + eval( 'window[ \'' + cbid +'\' ] = function( data ) {$j(\'#' + this.id + '\').get(0).'+ fName +'( data );}' ); |
136 | 113 | this.playerElement.addJsListener( bName , cbid); |
137 | 114 | }, |
138 | 115 | |
— | — | @@ -148,8 +125,8 @@ |
149 | 126 | * calls parent_play to update the interface |
150 | 127 | */ |
151 | 128 | play:function() { |
152 | | - if( this.playerElement && this.playerElement.dispatchKdpEvent ) |
153 | | - this.playerElement.dispatchKdpEvent('doPlay'); |
| 129 | + if( this.playerElement && this.playerElement.sendNotification ) |
| 130 | + this.playerElement.sendNotification( 'doPlay' ); |
154 | 131 | this.parent_play(); |
155 | 132 | }, |
156 | 133 | |
— | — | @@ -158,7 +135,7 @@ |
159 | 136 | * calls parent_pause to update the interface |
160 | 137 | */ |
161 | 138 | pause:function() { |
162 | | - this.playerElement.dispatchKdpEvent('doPause'); |
| 139 | + this.playerElement.sendNotification('doPause'); |
163 | 140 | this.parent_pause(); |
164 | 141 | }, |
165 | 142 | |
— | — | @@ -169,7 +146,7 @@ |
170 | 147 | var _this = this; |
171 | 148 | if( this.playerElement ) { |
172 | 149 | var seek_time = prec * this.getDuration(); |
173 | | - this.playerElement.dispatchKdpEvent('doSeek', seek_time); |
| 150 | + this.playerElement.sendNotification('doSeek', seek_time); |
174 | 151 | // Kdp is missing seek done callback |
175 | 152 | setTimeout(function() { |
176 | 153 | _this.seeking= false; |
— | — | @@ -182,21 +159,24 @@ |
183 | 160 | * Issues a volume update to the playerElement |
184 | 161 | */ |
185 | 162 | updateVolumen:function( percentage ) { |
186 | | - if( this.playerElement && this.playerElement.dispatchKdpEvent ) |
187 | | - this.playerElement.dispatchKdpEvent('volumeChange', percentage); |
| 163 | + if( this.playerElement && this.playerElement.sendNotification ) |
| 164 | + this.playerElement.sendNotification('volumeChange', percentage); |
188 | 165 | }, |
189 | 166 | |
190 | 167 | /** |
191 | | - * Monitors playback updating the current Time |
192 | | - */ |
193 | | - monitor:function() { |
194 | | - if( this.playerElement && this.playerElement.getMediaSeekTime ) { |
195 | | - this.currentTime = this.playerElement.getMediaSeekTime(); |
196 | | - } |
197 | | - this.parent_monitor(); |
| 168 | + * function called by flash at set interval to update the playhead. |
| 169 | + */ |
| 170 | + onUpdatePlayhead : function ( playheadValue ){ |
| 171 | + this.currentTime = playheadValue; |
198 | 172 | }, |
199 | 173 | |
200 | 174 | /** |
| 175 | + * We just use the parent monitor since currentTime is updated by push binding. |
| 176 | + * monitor: function(){ |
| 177 | + * } |
| 178 | + */ |
| 179 | + |
| 180 | + /** |
201 | 181 | * Get the embed fla object player Element |
202 | 182 | */ |
203 | 183 | getPlayerElement: function () { |
— | — | @@ -214,8 +194,12 @@ |
215 | 195 | |
216 | 196 | |
217 | 197 | |
| 198 | + |
218 | 199 | /*! SWFObject v2.2 <http://code.google.com/p/swfobject/> |
219 | 200 | is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> |
| 201 | +* |
| 202 | +* NOTE: we should seperate this out into a seperate file. It requires some minor |
| 203 | +* refactoring in how embedPlayer[s] are loaded. |
220 | 204 | */ |
221 | 205 | |
222 | 206 | var swfobject = function() { |
— | — | @@ -991,3 +975,4 @@ |
992 | 976 | } |
993 | 977 | }; |
994 | 978 | }(); |
| 979 | + |
Index: branches/js2-work/phase3/js/mwEmbed/modules/ApiProxy/ReceiveMessage.html |
— | — | @@ -1,12 +0,0 @@ |
2 | | -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
3 | | -<html> |
4 | | -<head> |
5 | | -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
6 | | -<title>iFrame message receiver</title> |
7 | | -<script type="text/javascript"> |
8 | | -</script> |
9 | | -</head> |
10 | | -<body> |
11 | | -iFrame message receiver. ( no javascript just a valid html file to get hash url updates ) |
12 | | -</body> |
13 | | -</html> |
\ No newline at end of file |
Index: branches/js2-work/phase3/js/mwEmbed/modules/ApiProxy/mw.ApiProxy.js |
— | — | @@ -755,7 +755,7 @@ |
756 | 756 | .attr({ |
757 | 757 | 'type' : 'hidden', |
758 | 758 | 'id' : "wpEditToken", |
759 | | - 'name' : 'token', |
| 759 | + 'name' : 'token' |
760 | 760 | }) |
761 | 761 | .val( clientRequest.token ) |
762 | 762 | ) |
— | — | @@ -960,9 +960,9 @@ |
961 | 961 | if( ! options[ 'target' ] ){ |
962 | 962 | options[ 'target' ] = 'body'; |
963 | 963 | } |
964 | | - var nameTarget = ( typeof options[ 'target' ] == 'string') ? options[ 'target' ] : $j( options[ 'target' ]).length ; |
965 | | - mw.log( "Append iframe:" + options[ 'src' ] + ' to: ' + nameTarget + " \n WITH REQUEST: " + JSON.stringify( options.request ) ); |
| 964 | + var targetName = ( typeof options[ 'target' ] == 'string') ? options[ 'target' ] : $j( options[ 'target' ]).length ; |
966 | 965 | |
| 966 | + mw.log( "Append iframe:" + options[ 'src' ] + ' to: ' + targetName + " \n WITH REQUEST: " + JSON.stringify( options.request ) ); |
967 | 967 | // Append to target |
968 | 968 | $j( options[ 'target' ] ).append( s ); |
969 | 969 | |
Index: branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | var urlparts = getRemoteEmbedPath(); |
7 | 7 | var mwEmbedHostPath = urlparts[0]; |
8 | 8 | var mwRemoteVersion = 'r104'; |
9 | | -var mwUseScriptLoader = true; |
| 9 | +var mwUseScriptLoader = false; |
10 | 10 | |
11 | 11 | // Log the mwRemote version ( will determine what version of js we get ) |
12 | 12 | if( window.console ){ |
— | — | @@ -117,12 +117,16 @@ |
118 | 118 | // Special api proxy page |
119 | 119 | if ( wgPageName == 'MediaWiki:ApiProxy' ) { |
120 | 120 | var wgEnableIframeApiProxy = true; |
| 121 | + alert( " MediaWiki:ApiProxy rewrite " ); |
121 | 122 | loadMwEmbed( [ 'mw.ApiProxy' ], function() { |
122 | 123 | mw.load( mwEmbedHostPath + '/apiProxyPage.js?' + mwGetReqArgs() ); |
123 | 124 | } ); |
124 | 125 | } |
| 126 | + |
| 127 | + // Special api proxy page for nested callback of hash url |
| 128 | + // Can be replaced with: |
125 | 129 | if ( wgPageName == 'MediaWiki:ApiProxyNestedCb' ) { |
126 | | - // Note top.mw.ApiProxy.nested frame needs to be on the same domain of course |
| 130 | + // Note top.mw.ApiProxy.nested frame needs to be on the same domain |
127 | 131 | top.mw.ApiProxy.nested( window.location.href.split("#")[1] || false ); |
128 | 132 | } |
129 | 133 | |