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.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.8 KiB

  1. <h2 class="d-flex justify-content-center">{videoURL}</h2>
  2. <div class="d-flex justify-content-center p-4">
  3. <video id="videoPlayer" width="768" height="432" controls onerror="failed(event)">
  4. <source src="/video?v={videoURL}" type="video/mp4">
  5. Your browser does not support the video tag.
  6. </video>
  7. </div>
  8. <div class="d-flex justify-content-center p-4">
  9. <p id="copyStatus"></p>
  10. <input class="form-control" type="text" value="{serverURL}/video\?v\={videoURL}\&api\={api}" id="directLink">
  11. <button class="btn btn-secondary align-content-center" onclick="copyVideoPath()">Copy Direct Link</button>
  12. </div>
  13. <script>
  14. function copyVideoPath()
  15. {
  16. var copyText = document.getElementById("directLink");
  17. copyText.select();
  18. document.execCommand("copy");
  19. $("#copyStatus").html("URL copied to clipboard.");
  20. }
  21. function failed(e)
  22. {
  23. // video playback failed - show a message saying why
  24. switch (e.target.error.code)
  25. {
  26. case e.target.error.MEDIA_ERR_ABORTED:
  27. alert('You aborted the video playback.');
  28. break;
  29. case e.target.error.MEDIA_ERR_NETWORK:
  30. alert('A network error caused the video download to fail part-way.');
  31. break;
  32. case e.target.error.MEDIA_ERR_DECODE:
  33. alert('The video playback was aborted due to a corruption problem or because the video used features your browser did not support.');
  34. break;
  35. case e.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED:
  36. alert('The video could not be loaded, either because the server or network failed or because the format is not supported.');
  37. break;
  38. default:
  39. alert('An unknown error occurred.');
  40. break;
  41. }
  42. }
  43. </script>