]> _ Git - fluidbook-html5.git/commitdiff
fix #3933 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 22 Oct 2020 16:29:54 +0000 (18:29 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 22 Oct 2020 16:29:54 +0000 (18:29 +0200)
js/libs/fluidbook/fluidbook.video.js

index 03dbd59c34819e3d843e273fe8599174e9629bd9..1960d46098f9c2cb57ed109ae4fb2910d44eb1b2 100644 (file)
@@ -95,6 +95,7 @@ FluidbookVideo.prototype = {
             autoplay = $(e).data('autoplay'),
             setup = $(e).data('setup'),
             linkid = $(e).data('link-id'),
+            url = $(e).data('url'),
             path,
             poster,
             html,
@@ -121,8 +122,9 @@ FluidbookVideo.prototype = {
                 path = '../' + path;
             }
         }
-
-        if (name !== '') {
+        if (url) {
+            path = url;
+        } else if (name !== '') {
             poster = path + '.jpg';
         }
 
@@ -172,7 +174,11 @@ FluidbookVideo.prototype = {
         // List all possible formats (only applicable for locally hosted videos)
         if (name !== '') {
             this.videoFormats.forEach(function (format) {
-                html += '<source src="' + path + '.' + format + '">';
+                var p = path;
+                if (p.indexOf('.' + format) === -1) {
+                    p += '.' + format;
+                }
+                html += '<source src="' + p + '">';
             });
         }