src/js/init.js
branchpopcorn-port
changeset 709 05ae2aa10d24
parent 707 1ebfd2a7366b
child 743 69a9969daa41
--- a/src/js/init.js	Mon Jan 23 17:27:37 2012 +0100
+++ b/src/js/init.js	Wed Jan 25 15:38:46 2012 +0100
@@ -47,14 +47,15 @@
           delete opts.container;
           delete opts.type;
 
-          if (options.provider === "rtmp") {
+          
+          /* Try to guess options.file and options.streamer only if file and streamer
+             are not already defined in the configuration */
+          if (options.provider === "rtmp" && !opts.hasOwnProperty("file") && !opts.hasOwnProperty("streamer")) {
             /* 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"];
@@ -81,8 +82,7 @@
                  if (i < pathSplit.length - 1)
                   opts.file += "/";
               }
-            }
-
+            }            
           } else {
             /* other providers type, video for instance -
                pass everything as is */
@@ -96,7 +96,7 @@
             opts["controlbar.position"] = "none";
           }
 
-          pop = IriSP.PopcornReplacement.jwplayer("#" + containerDiv, opts);
+          pop = new IriSP.PopcornReplacement.jwplayer("#" + containerDiv, opts);
         break;
       
       case "youtube":
@@ -112,6 +112,11 @@
           pop = Popcorn.youtube("#" + containerDiv, opts.video, opts);
         break;
         
+      case "allocine":
+          /* pass the options as-is to the allocine player and let it handle everything */
+          pop = new IriSP.PopcornReplacement.allocine("#" + containerDiv, options);
+          break;
+          
       default:
         pop = undefined;
     };