# HG changeset patch # User hamidouk # Date 1323858375 -3600 # Node ID 7fcdb501effdc97b235af38dc77d6f41579317ee # Parent d0dd2b30106c9ea1a16fda75045e48801b4eb36b added a switch to choose different options if using rtmp or not. diff -r d0dd2b30106c -r 7fcdb501effd src/js/init.js --- a/src/js/init.js Wed Dec 14 11:25:41 2011 +0100 +++ b/src/js/init.js Wed Dec 14 11:26:15 2011 +0100 @@ -37,19 +37,25 @@ var opts = IriSP.jQuery.extend({}, options); delete opts.container; - /* exit if we can't access the metadata */ - if (typeof(IriSP.__jsonMetadata) === "undefined") { - break; - }; + if (options.provider === "rtmp") { + /* exit if we can't access the metadata */ + if (typeof(IriSP.__jsonMetadata) === "undefined") { + break; + }; - // the json format is totally illogical - opts.streamer = IriSP.__jsonMetadata["medias"][0]["meta"]["item"]["value"]; - var source = IriSP.__jsonMetadata["medias"][0]["href"]; + // the json format is totally illogical + opts.streamer = IriSP.__jsonMetadata["medias"][0]["meta"]["item"]["value"]; + var source = IriSP.__jsonMetadata["medias"][0]["href"]; - // the source if a full url but jwplayer wants an url relative to the - // streamer url, so we've got to remove the common part. - opts.file = source.slice(opts.streamer.length); + // the source if a full url but jwplayer wants an url relative to the + // streamer url, so we've got to remove the common part. + opts.file = source.slice(opts.streamer.length); + } else { + /* other providers type, video for instance - + pass everything as is */ + } + pop = IriSP.PopcornReplacement.jwplayer("#" + containerDiv, opts); break;