From: rwldrn Date: Mon, 17 Jan 2011 21:07:51 +0000 (-0500) Subject: [#266] Support for parsername:file,* X-Git-Tag: v0.3~29^2~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=09589645f08a5318aa243472c815a1f41d313971;p=popcorn-js.git [#266] Support for parsername:file,* --- diff --git a/popcorn.js b/popcorn.js index c6953e7..6cc02d1 100644 --- a/popcorn.js +++ b/popcorn.js @@ -876,11 +876,21 @@ Popcorn.forEach( dataSources, function ( source ) { - dataTemp = source.split( "." ); + dataTemp = source.split( ":" ); - dataType = ( dataTemp[ dataTemp.length - 1 ] ).toUpperCase(); - - parserFn = "parse" + ( dataTemp[ dataTemp.length - 1 ] ).toUpperCase(); + dataType = dataTemp[0]; + + if ( dataTemp.length === 1 ) { + + dataTemp = source.split( "." ); + + dataType = dataTemp[ dataTemp.length - 1 ]; + + } + + dataType.toUpperCase(); + + parserFn = "parse" + dataType; // If the video has data sources and the correct parser is registered, continue to load if ( dataSources && Popcorn.parsers[ dataType ] ) {