filesafe/views/player.njk

100 lines
3.6 KiB
Plaintext
Raw Normal View History

{%- import '_globals.njk' as globals -%}
{% set metaTitle = "Player" %}
{% set uploadRoot = config.domain %}
{% set titleFormat = '%identifier% | ' + globals.name %}
{% extends "_layout.njk" %}
{% block stylesheets %}
<!-- Libs stylesheets -->
<link rel="stylesheet" href="../libs/fontello/fontello.css{{ versions[1] }}">
<link rel="stylesheet" href="../libs/video-js/video-js.min.css{{ versions[3] }}">
<link rel="stylesheet" href="../libs/videojs-seek-buttons/videojs-seek-buttons.min.css{{ versions[3] }}">
<link rel="stylesheet" href="../libs/videojs-wavesurfer/videojs.wavesurfer.min.css{{ versions[3] }}">
<!-- Stylesheets -->
<link rel="stylesheet" href="../css/style.css{{ versions[1] }}">
<link rel="stylesheet" href="../css/sweetalert.css{{ versions[1] }}">
<link rel="stylesheet" href="../css/player.css{{ versions[1] }}">
{% endblock %}
{% block scripts %}
{% if not nojs -%}
<!-- Libs scripts -->
<script src="../libs/sweetalert/sweetalert.min.js{{ versions[3] }}"></script>
<script src="../libs/axios/axios.min.js{{ versions[3] }}"></script>
<script src="../libs/video-js/video.min.js{{ versions[3] }}"></script>
<script src="../libs/video-js/lang/en.js{{ versions[3] }}"></script>
<script src="../libs/videojs-seek-buttons/videojs-seek-buttons.min.js{{ versions[3] }}"></script>
<script src="../libs/wavesurfer-js/wavesurfer.min.js{{ versions[3] }}"></script>
<script src="../libs/videojs-wavesurfer/videojs.wavesurfer.min.js{{ versions[3] }}"></script>
<!-- Scripts -->
{# We assign an ID for this so that the script can find out proper root URL of uploaded files #}
<script id="mainScript" src="../js/player.js{{ versions[1] }}" data-upload-root="{{ uploadRoot }}" data-title-format="
{{ titleFormat }}"></script>
<script src="../js/misc/utils.js{{ versions[1] }}"></script>
{%- endif %}
{% endblock %}
{% block endmeta %}
{% include "_partial/noscript-refresh.njk" %}
{% endblock %}
{% block content %}
{{ super() }}
<section class="section has-extra-bottom-padding">
<div class="container">
<nav class="level">
<div class="level-left">
<div class="level-item">
<h1 id="title" class="title">
{{ metaTitle }}
</h1>
</div>
</div>
<div class="level-right">
<p class="level-item">
2020-11-03 14:57:43 +00:00
<a id="downloadBtn" class="button is-primary is-outlined">
<span class="icon">
<i class="icon-download"></i>
</span>
<span>Download media</span>
</a>
</p>
</div>
</nav>
<hr>
<form id="inputForm">
<div class="field has-addons">
<div class="control is-expanded">
2020-11-03 14:57:43 +00:00
<input id="identifier" name="identifier" class="input" type="text" placeholder="Upload's file name" minlength="1">
</div>
<div class="control">
<button id="reloadBtn" class="button is-info is-outlined">
<span class="icon">
<i class="icon-arrows-cw"></i>
</span>
</button>
</div>
</div>
</form>
2020-11-03 14:25:07 +00:00
<div id="playerContainer"></div>
<article class="message">
<div class="message-body">
2020-11-03 14:57:43 +00:00
<p>This is an experimental embedded media player using <a href="https://github.com/videojs/video.js" target="_blank" rel="noopener">Video.js</a>.</p>
<p>This only allows you to play media uploads that you can play directly on your browser in the first place, and thus there is no additional support for other formats such as MKV.</p>
</div>
</article>
</div>
</section>
{% set floatingHomeHref = '..' %}
{% include "_partial/floating-home.njk" %}
{% include "_partial/noscript.njk" %}
{% endblock %}