Lightweight node app to use in place of plex to self host your video and movie collections. Running on just under 50MB of ram this is ideal for people looking to host videos on minimal hardware.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 

47 lines
1.8 KiB

<h2 class="d-flex justify-content-center">{videoURL}</h2>
<div class="d-flex justify-content-center p-4">
<video id="videoPlayer" width="768" height="432" controls onerror="failed(event)">
<source src="/video?v={videoURL}" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>
<div class="d-flex justify-content-center p-4">
<p id="copyStatus"></p>
<input class="form-control" type="text" value="{serverURL}/video\?v\={videoURL}\&api\={api}" id="directLink">
<button class="btn btn-secondary align-content-center" onclick="copyVideoPath()">Copy Direct Link</button>
</div>
<script>
function copyVideoPath()
{
var copyText = document.getElementById("directLink");
copyText.select();
document.execCommand("copy");
$("#copyStatus").html("URL copied to clipboard.");
}
function failed(e)
{
// video playback failed - show a message saying why
switch (e.target.error.code)
{
case e.target.error.MEDIA_ERR_ABORTED:
alert('You aborted the video playback.');
break;
case e.target.error.MEDIA_ERR_NETWORK:
alert('A network error caused the video download to fail part-way.');
break;
case e.target.error.MEDIA_ERR_DECODE:
alert('The video playback was aborted due to a corruption problem or because the video used features your browser did not support.');
break;
case e.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED:
alert('The video could not be loaded, either because the server or network failed or because the format is not supported.');
break;
default:
alert('An unknown error occurred.');
break;
}
}
</script>