src/js/init.js
branchpopcorn-port
changeset 456 7fcdb501effd
parent 453 8568e47379a2
child 461 a9c5eeca190c
equal deleted inserted replaced
455:d0dd2b30106c 456:7fcdb501effd
    35         
    35         
    36       case "jwplayer":
    36       case "jwplayer":
    37           var opts = IriSP.jQuery.extend({}, options);
    37           var opts = IriSP.jQuery.extend({}, options);
    38           delete opts.container;
    38           delete opts.container;
    39 
    39 
    40           /* exit if we can't access the metadata */
    40           if (options.provider === "rtmp") {
    41           if (typeof(IriSP.__jsonMetadata) === "undefined") {
    41             /* exit if we can't access the metadata */
    42               break;
    42             if (typeof(IriSP.__jsonMetadata) === "undefined") {
    43           };
    43                 break;
       
    44             };
    44 
    45 
    45 
    46 
    46           // the json format is totally illogical
    47             // the json format is totally illogical
    47           opts.streamer = IriSP.__jsonMetadata["medias"][0]["meta"]["item"]["value"];
    48             opts.streamer = IriSP.__jsonMetadata["medias"][0]["meta"]["item"]["value"];
    48           var source = IriSP.__jsonMetadata["medias"][0]["href"];
    49             var source = IriSP.__jsonMetadata["medias"][0]["href"];
    49 
    50 
    50           // the source if a full url but jwplayer wants an url relative to the
    51             // the source if a full url but jwplayer wants an url relative to the
    51           // streamer url, so we've got to remove the common part.
    52             // streamer url, so we've got to remove the common part.
    52           opts.file = source.slice(opts.streamer.length);
    53             opts.file = source.slice(opts.streamer.length);
       
    54           } else {
       
    55             /* other providers type, video for instance -
       
    56                pass everything as is */
       
    57           }
       
    58 
    53           pop = IriSP.PopcornReplacement.jwplayer("#" + containerDiv, opts);
    59           pop = IriSP.PopcornReplacement.jwplayer("#" + containerDiv, opts);
    54         break;
    60         break;
    55       
    61       
    56       case "youtube":
    62       case "youtube":
    57           var opts = IriSP.jQuery.extend({}, options);
    63           var opts = IriSP.jQuery.extend({}, options);