src/js/init.js
branchpopcorn-port
changeset 822 45083178c1d2
parent 816 e97e22801146
child 827 1dc2f85c3b89
--- a/src/js/init.js	Thu Mar 01 17:28:36 2012 +0100
+++ b/src/js/init.js	Thu Mar 01 17:33:52 2012 +0100
@@ -76,14 +76,9 @@
             */
             opts.file = "";
             opts.streamer = "";
-            var fullPath = IriSP.__jsonMetadata["medias"][0]["href"];
+            var fullPath = IriSP.get_aliased(IriSP.__jsonMetadata["medias"][0], ["href","url"]);
             
-            /* 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)) {
+            if (fullPath === null) {
               console.log("no url or href field defined in the metadata.");
             }