@@ -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,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());
@@ -3,5 +3,9 @@
</textarea>
- $("#embeddedCode").text(`<img src="${location.protocol}//${window.location.hostname}:${window.location.port}{{preview_url}}" style="width: 30em"/>`);
+ $("#embeddedCode").text(`<img src="${location.protocol}//${window.location.hostname}${port}{{preview_url}}{{filename}}" style="width: 30em"/>`);
@@ -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>`);
+ $("#embeddedCode").text(`<video src="${location.protocol}//${window.location.hostname}${port}{{preview_url}}{{filename}}" style="width:560px; height: 340px; background-color: #000000;" controls></video>`);