try another approach

This commit is contained in:
deflax 2024-01-20 00:41:55 +02:00
parent 2e9cafc731
commit 5bd1e3ca18

View file

@ -21,12 +21,7 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/plyr/dist/plyr.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/plyr/dist/plyr.min.css">
<style> <style>
body { body {
margin: 0; background-color: #212529;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #212529;
} }
#player-container { #player-container {
@ -34,16 +29,42 @@
height: 100vh; /* 100% of the viewport height */ height: 100vh; /* 100% of the viewport height */
object-fit: cover; /* This ensures the video covers the entire container, maintaining its aspect ratio */ object-fit: cover; /* This ensures the video covers the entire container, maintaining its aspect ratio */
} }
.video-container {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
.video-container video {
/* Make video to at least 100% wide and tall */
min-width: 100%;
min-height: 100%;
/* Setting width & height to auto prevents the browser from stretching or squishing the video */
width: auto;
height: auto;
/* Center the video */
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
</style> </style>
<title>DeflaxTV Video Player</title> <title>DeflaxTV Video Player</title>
</head> </head>
<body> <body>
<div id="player-container"> <div class="video-container">
<video id="player" playsinline controls> <video>
<source src="{{ url_for('video_route', file_name=video_file) }}" type="video/mp4"> <source src="{{ url_for('video_route', file_name=video_file) }}" type="video/mp4">
</video> </video>
</div> </div>
<script src="https://cdn.jsdelivr.net/npm/plyr/dist/plyr.min.js" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/plyr/dist/plyr.min.js" crossorigin="anonymous"></script>
<script> <script>
document.addEventListener('DOMContentLoaded', function () { document.addEventListener('DOMContentLoaded', function () {