r73764 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73763‎ | r73764 | r73765 >
Date:01:07, 26 September 2010
Author:dale
Status:deferred
Tags:
Comment:
* improved swarmTransport for IE
* fixed minor IE issue with console log errors for resource loader
* don't do video overlay if already playing
Modified paths:
  • /branches/MwEmbedStandAlone/ResourceLoader.php (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.Smil.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SwarmTransport/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SwarmTransport/mw.EmbedPlayerSwamVlc.js (deleted) (history)
  • /branches/MwEmbedStandAlone/modules/SwarmTransport/mw.EmbedPlayerSwarmVlc.js (added) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/ResourceLoader.php
@@ -197,7 +197,7 @@
198198 if ( $this->errorMsg != '' ) {
199199 //just set the content type (don't send cache header)
200200 header( 'Content-Type: text/javascript' );
201 - echo 'if(console.log)console.log(\'Error With ResourceLoader ::' .
 201+ echo 'if(console && console.log)console.log(\'Error With ResourceLoader ::' .
202202 str_replace( "\n", '\'+"\n"+' . "\n'",
203203 xml::escapeJsString( $this->errorMsg )
204204 ) . '\');'."\n";
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.Smil.js
@@ -125,6 +125,7 @@
126126 // Remove any non-smil nodes that are in the page dom
127127 this.getBody().syncPageDom();
128128 },
 129+
129130 // simple XML DOMParser object parser wrapper
130131 // xxx Add error handling
131132 getXMLDomObject: function( smilXmlString ){
@@ -171,8 +172,7 @@
172173
173174 /**
174175 * We use animateTime instead of a tight framerate loop so that we can
175 - * optimize with css transformations
176 - *
 176+ * optimize with browser css transformations
177177 */
178178 animateTime : function(time, timeDelta) {
179179 // mw.log("Smil::animateTime: " + time + ' delta: ' + timeDelta );
Index: branches/MwEmbedStandAlone/modules/SwarmTransport/mw.EmbedPlayerSwamVlc.js
@@ -1,37 +0,0 @@
2 -/*
3 -* Swarm VLC embed
4 -* inherits EmbedPlayerVlc
5 -*/
6 -mw.EmbedPlayerSwarmVlc = {
7 -
8 - //Instance Name:
9 - instanceOf : 'SwarmVlc',
10 -
11 - doEmbedHTML: function() {
12 - var _this = this;
13 - var oggHttpSource = this.mediaElement.getSources( 'video/ogg' )[0];
14 - $j( this ).html(
15 - '<object classid="clsid:98FF91C0-A3B8-11DF-8555-0002A5D5C51B" ' +
16 - 'id="' + this.pid + '" events="True" height="' + this.getHeight() + '" width="' + this.getWidth() + '"' +
17 - '>' +
18 - '<param name="ShowDisplay" value="True" />' +
19 - '<param name="AutoLoop" value="False" />' +
20 - '<param name="AutoPlay" value="True" />' +
21 - '<param name="Volume" value="'+ this.volume * 100 + '" />' +
22 - '<param name="Src" value="' + this.getSrc() +'" />' +
23 - '<param name="AltSrc" value="' + mw.absoluteUrl( oggHttpSource.getSrc() ) + '" />' +
24 - '</object>'
25 - );
26 - setTimeout( function() {
27 - _this.monitor();
28 - }, 100 );
29 - }
30 -};
31 -// Inherit the vlc object
32 -if( typeof mw.EmbedPlayerVlc == 'undefined' ){
33 - mw.log("Error:: EmbedPLayerVlc not defefined ");
34 -} else {
35 - for(var i in mw.EmbedPlayerVlc.prototype ){
36 - mw.EmbedPlayerSwarmVlc
37 - };
38 -}
Index: branches/MwEmbedStandAlone/modules/SwarmTransport/loader.js
@@ -9,7 +9,7 @@
1010
1111 mw.addResourcePaths( {
1212 "mw.SwarmTransport" : "mw.SwarmTransport.js",
13 - "mw.EmbedPlayerSwamVlc" : "mw.EmbedPlayerSwamVlc.js"
 13+ "mw.EmbedPlayerSwarmVlc" : "mw.EmbedPlayerSwarmVlc.js"
1414 });
1515
1616 mw.setDefaultConfig({
Index: branches/MwEmbedStandAlone/modules/SwarmTransport/mw.EmbedPlayerSwarmVlc.js
@@ -0,0 +1,40 @@
 2+/*
 3+* Swarm VLC embed
 4+* inherits EmbedPlayerVlc
 5+*/
 6+mw.EmbedPlayerSwarmVlc = {
 7+
 8+ //Instance Name:
 9+ instanceOf : 'SwarmVlc',
 10+
 11+ doEmbedHTML: function() {
 12+ var _this = this;
 13+ var oggHttpSource = this.mediaElement.getSources( 'video/ogg' )[0];
 14+ $j( this ).html(
 15+ '<object classid="clsid:98FF91C0-A3B8-11DF-8555-0002A5D5C51B" ' +
 16+ 'id="' + this.pid + '" events="True" height="' + this.getHeight() + '" width="' + this.getWidth() + '"' +
 17+ '>' +
 18+ '<param name="ShowDisplay" value="True" />' +
 19+ '<param name="AutoLoop" value="False" />' +
 20+ '<param name="AutoPlay" value="True" />' +
 21+ '<param name="Volume" value="'+ this.volume * 100 + '" />' +
 22+ '<param name="Src" value="' + this.getSrc() +'" />' +
 23+ '<param name="AltSrc" value="' + mw.absoluteUrl( oggHttpSource.getSrc() ) + '" />' +
 24+ '</object>'
 25+ );
 26+ setTimeout( function() {
 27+ _this.monitor();
 28+ }, 100 );
 29+ }
 30+};
 31+
 32+// Inherit the vlc object
 33+if( typeof mw.EmbedPlayerVlc == 'undefined' ){
 34+ mw.log("Error:: EmbedPLayerVlc not defefined ");
 35+} else {
 36+ for( var i in mw.EmbedPlayerVlc ){
 37+ if( !mw.EmbedPlayerSwarmVlc[ i ] ){
 38+ mw.EmbedPlayerSwarmVlc[ i ] = mw.EmbedPlayerVlc[i];
 39+ }
 40+ };
 41+}
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js
@@ -722,7 +722,11 @@
723723
724724 $j( embedPlayer ).hoverIntent({
725725 'timeout': 2000,
726 - 'over': function() {
 726+ 'over': function() {
 727+ // don't do the overlay if already playing
 728+ if( embedPlayer.isPlaying() ){
 729+ return ;
 730+ }
727731 if ( $j( '#warningOverlay_' + embedPlayer.id ).length == 0 ) {
728732
729733 $j( this ).append(

Status & tagging log