src/js/init.js
branchpopcorn-port
changeset 816 e97e22801146
parent 811 b9dd62e35e30
child 822 45083178c1d2
--- a/src/js/init.js	Fri Feb 17 11:56:02 2012 +0100
+++ b/src/js/init.js	Fri Feb 17 11:56:33 2012 +0100
@@ -77,6 +77,16 @@
             opts.file = "";
             opts.streamer = "";
             var fullPath = IriSP.__jsonMetadata["medias"][0]["href"];
+            
+            /* files can either use href or url to refer to the stream */
+            if (IriSP.null_or_undefined(fullPath)) {
+              fullPath = IriSP.__jsonMetadata["medias"][0]["url"];
+            }
+            
+            if (IriSP.null_or_undefined(fullPath)) {
+              console.log("no url or href field defined in the metadata.");
+            }
+            
             var pathSplit = fullPath.split('/');
             
             for (var i = 0; i < pathSplit.length; i++) {