r67276 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67275‎ | r67276 | r67277 >
Date:09:12, 3 June 2010
Author:dale
Status:deferred
Tags:
Comment:
* fixed bug for empty source
Modified paths:
  • /branches/MwEmbedStandAlone/modules/SwarmTransport/mw.SwarmTransport.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/modules/SwarmTransport/mw.SwarmTransport.js
@@ -65,7 +65,12 @@
6666 var finishAddSwarmSource = function(){
6767 // Get the highest quality source that the system can playback
6868 // ( for now just grab the first ogg/theora )
69 - var source = embedPlayer.mediaElement.getSources( 'video/ogg' )[0];
 69+ var source = embedPlayer.mediaElement.getSources( 'video/ogg' )[0];
 70+ if( ! source ){
 71+ mw.log("Error: addSwarmSource: could not find video/ogg source");
 72+ callback();
 73+ return ;
 74+ }
7075 var absoluteSource = mw.absoluteUrl( source.getSrc() );
7176 var swarmSrc = httpseed2tstream( absoluteSource );
7277

Status & tagging log