Эх сурвалжийг харах

Fixed share interface url generaotr

tobychui 3 жил өмнө
parent
commit
768ecd5b78

+ 5 - 1
system/share/audio.html

@@ -5,6 +5,10 @@
     player=document.getElementById("audioplayer");
     player.volume=0.2;
 
-    $("#embeddedCode").text(`<audio id="audioplayer" src="${location.protocol}//${window.location.hostname}:${window.location.port}{{preview_url}}" style="width: 400px" controls></audio>`);
+    var port = window.location.port;
+    if (port != ""){
+        port = ":" + port;
+    }
+    $("#embeddedCode").text(`<audio id="audioplayer" src="${location.protocol}//${window.location.hostname}${port}{{preview_url}}{{filename}}" style="width: 400px" controls></audio>`);
 </script>
     

+ 1 - 1
system/share/iframe.html

@@ -1,4 +1,4 @@
-<iframe id="previewIframe" src="{{preview_url}}" style="width: 100%; height: 500px;"></iframe>
+<iframe id="previewIframe" src="{{preview_url}}{{filename}}" style="width: 100%; height: 500px;"></iframe>
 <script>
 $(window).on("resize", function(previewIframe){
     $("#previewIframe").css("width", $("#previewIframe").parent().width());

+ 5 - 1
system/share/image.html

@@ -3,5 +3,9 @@
     
 </textarea>
 <script>
-     $("#embeddedCode").text(`<img src="${location.protocol}//${window.location.hostname}:${window.location.port}{{preview_url}}" style="width: 30em"/>`);
+     var port = window.location.port;
+     if (port != ""){
+          port = ":" + port;
+     }
+     $("#embeddedCode").text(`<img src="${location.protocol}//${window.location.hostname}${port}{{preview_url}}{{filename}}" style="width: 30em"/>`);
 </script>

+ 5 - 1
system/share/video.html

@@ -7,5 +7,9 @@
     document.getElementsByTagName('video')[0].volume = 0.2;
 
     //Render an embedded code for this video preview
-    $("#embeddedCode").text(`<video src="${location.protocol}//${window.location.hostname}:${window.location.port}{{preview_url}}" style="width:560px; height: 340px; background-color: #000000;" controls></video>`);
+    var port = window.location.port;
+    if (port != ""){
+        port = ":" + port;
+    }
+    $("#embeddedCode").text(`<video src="${location.protocol}//${window.location.hostname}${port}{{preview_url}}{{filename}}" style="width:560px; height: 340px; background-color: #000000;" controls></video>`);
 </script>