put back plyr.js and remove the filename extension from the watch route
This commit is contained in:
parent
469f7cdfe9
commit
87fa946046
3 changed files with 12 additions and 3 deletions
|
@ -147,7 +147,8 @@ async def query_database():
|
||||||
# Creating an embed
|
# Creating an embed
|
||||||
video_url = f'https://{scheduler_hostname}/video/{video_filename}'
|
video_url = f'https://{scheduler_hostname}/video/{video_filename}'
|
||||||
thumb_url = f'https://{scheduler_hostname}/thumb/{thumb_filename}'
|
thumb_url = f'https://{scheduler_hostname}/thumb/{thumb_filename}'
|
||||||
watch_url = f'https://{scheduler_hostname}/watch/{video_filename}'
|
video_filename_no_extension = video_filename.split('.')[0]
|
||||||
|
watch_url = f'https://{scheduler_hostname}/watch/{video_filename_no_extension}'
|
||||||
img_url = f'https://{scheduler_hostname}/img'
|
img_url = f'https://{scheduler_hostname}/img'
|
||||||
embed = discord.Embed(title=f'{rec_stream_name}',
|
embed = discord.Embed(title=f'{rec_stream_name}',
|
||||||
url=f'{watch_url}',
|
url=f'{watch_url}',
|
||||||
|
|
|
@ -331,8 +331,9 @@ def img_route(file_name):
|
||||||
abort(404)
|
abort(404)
|
||||||
return send_file(reqfile, mimetype='image/png')
|
return send_file(reqfile, mimetype='image/png')
|
||||||
|
|
||||||
@app.route('/watch/<file_name>')
|
@app.route('/watch/<file_name_no_extension>')
|
||||||
def watch_route(file_name):
|
def watch_route(file_name_no_extension):
|
||||||
|
file_name = file_name_no_extension + '.mp4'
|
||||||
reqfile = f'{rec_path}/vod/{file_name}'
|
reqfile = f'{rec_path}/vod/{file_name}'
|
||||||
if not os.path.exists(reqfile):
|
if not os.path.exists(reqfile):
|
||||||
abort(404)
|
abort(404)
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/plyr/dist/plyr.min.css">
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
@ -28,6 +29,12 @@
|
||||||
<source src="{{ video_url }}" type="video/mp4">
|
<source src="{{ video_url }}" type="video/mp4">
|
||||||
</video>
|
</video>
|
||||||
</div>
|
</div>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/plyr/dist/plyr.min.js" crossorigin="anonymous"></script>
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
const player = new Plyr('#player');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue