src/js/init.js
branchpopcorn-port
changeset 816 e97e22801146
parent 811 b9dd62e35e30
child 822 45083178c1d2
equal deleted inserted replaced
815:44d34270541c 816:e97e22801146
    75                the rest, we uglily do this :
    75                the rest, we uglily do this :
    76             */
    76             */
    77             opts.file = "";
    77             opts.file = "";
    78             opts.streamer = "";
    78             opts.streamer = "";
    79             var fullPath = IriSP.__jsonMetadata["medias"][0]["href"];
    79             var fullPath = IriSP.__jsonMetadata["medias"][0]["href"];
       
    80             
       
    81             /* files can either use href or url to refer to the stream */
       
    82             if (IriSP.null_or_undefined(fullPath)) {
       
    83               fullPath = IriSP.__jsonMetadata["medias"][0]["url"];
       
    84             }
       
    85             
       
    86             if (IriSP.null_or_undefined(fullPath)) {
       
    87               console.log("no url or href field defined in the metadata.");
       
    88             }
       
    89             
    80             var pathSplit = fullPath.split('/');
    90             var pathSplit = fullPath.split('/');
    81             
    91             
    82             for (var i = 0; i < pathSplit.length; i++) {
    92             for (var i = 0; i < pathSplit.length; i++) {
    83               if (i < 4) {
    93               if (i < 4) {
    84                  opts.streamer += pathSplit[i] + "/";
    94                  opts.streamer += pathSplit[i] + "/";