src/js/init.js
branchpopcorn-port
changeset 456 7fcdb501effd
parent 453 8568e47379a2
child 461 a9c5eeca190c
--- 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;