Index: branches/MwEmbedStandAlone/modules/SwarmTransport/mw.SwarmTransport.js |
— | — | @@ -65,7 +65,12 @@ |
66 | 66 | var finishAddSwarmSource = function(){ |
67 | 67 | // Get the highest quality source that the system can playback |
68 | 68 | // ( 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 | + } |
70 | 75 | var absoluteSource = mw.absoluteUrl( source.getSrc() ); |
71 | 76 | var swarmSrc = httpseed2tstream( absoluteSource ); |
72 | 77 | |