Make metadataplayer autoplayer check lower case string to test for video type
authorymh <ymh.work@gmail.com>
Sun, 12 Nov 2017 22:05:19 +0100
changeset 1493 351716535c42
parent 1492 b3f561096d52
child 1494 5e6295488e38
Make metadataplayer autoplayer check lower case string to test for video type
src/ldt/ldt/static/ldt/metadataplayer/AutoPlayer.js
--- a/src/ldt/ldt/static/ldt/metadataplayer/AutoPlayer.js	Thu Jul 06 16:06:21 2017 +0200
+++ b/src/ldt/ldt/static/ldt/metadataplayer/AutoPlayer.js	Sun Nov 12 22:05:19 2017 +0100
@@ -9,11 +9,11 @@
 };
 
 IriSP.Widgets.AutoPlayer.prototype.draw = function() {
-    
+
     if (typeof this.video === "undefined") {
         this.video = this.media.video;
     }
-    
+
     var _props = [ "live", "provider", "autostart", "streamer", "video", "height", "width", "url_transform" ],
         _opts = {},
         _types = [
@@ -43,28 +43,28 @@
             }
         ],
         _rtmprgx = /^rtmp:\/\//;
-    
+
     for (var i = 0; i < _types.length; i++) {
-        if (_types[i].regexp.test(this.video)) {
+        if (this.video && _types[i].regexp.test(this.video.toLowerCase())) {
             _opts.type =  _types[i].type;
             break;
         }
     }
-    
+
     if (typeof _opts.type === "undefined") {
         _opts.type = this.default_type;
     }
-    
+
     if (_opts.type === "AdaptivePlayer") {
         var _canPlayType = document.createElement('video').canPlayType('video/mp4; codecs="avc1.42E01E"');
         _opts.type = (_canPlayType !== "no") ? "HtmlPlayer" : "JwpPlayer";
     }
-    
+
     if (_rtmprgx.test(this.video)) {
         _opts.provider = "rtmp";
         _opts.live = true;
     }
-    
+
     for (var i = 0; i < _props.length; i++) {
         if (typeof this[_props[i]] !== "undefined") {
             _opts[_props[i]] = this[_props[i]];
@@ -72,5 +72,5 @@
     }
 
     this.insertSubwidget(this.$, _opts);
-    
-};
\ No newline at end of file
+
+};