Spaces:
Sleeping
Sleeping
Update bot/server/templates/player.html
Browse files- bot/server/templates/player.html +286 -87
bot/server/templates/player.html
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
-
<title>
|
| 5 |
|
| 6 |
<meta charset="UTF-8">
|
| 7 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
@@ -9,20 +9,34 @@
|
|
| 9 |
|
| 10 |
<link rel="stylesheet" href="https://cdn.plyr.io/3.7.8/plyr.css" />
|
| 11 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
|
|
|
|
| 12 |
|
| 13 |
<script src="https://cdn.plyr.io/3.7.8/plyr.polyfilled.js"></script>
|
| 14 |
|
| 15 |
<style>
|
| 16 |
:root {
|
| 17 |
-
--primary-color: #
|
| 18 |
-
--secondary-color: #
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
}
|
| 20 |
|
| 21 |
html, body {
|
| 22 |
margin: 0;
|
| 23 |
height: 100%;
|
| 24 |
-
font-family: '
|
| 25 |
-
background-color:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
}
|
| 27 |
|
| 28 |
#stream-media {
|
|
@@ -30,150 +44,308 @@
|
|
| 30 |
width: 100%;
|
| 31 |
}
|
| 32 |
|
|
|
|
| 33 |
#error-message {
|
| 34 |
-
color: red;
|
| 35 |
-
font-size: 24px;
|
| 36 |
-
text-align: center;
|
| 37 |
-
margin-top: 20px;
|
| 38 |
-
background-color: rgba(0, 0, 0, 0.7);
|
| 39 |
-
padding: 10px;
|
| 40 |
-
border-radius: 5px;
|
| 41 |
position: absolute;
|
| 42 |
top: 50%;
|
| 43 |
left: 50%;
|
| 44 |
transform: translate(-50%, -50%);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
display: none;
|
|
|
|
|
|
|
| 46 |
}
|
| 47 |
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
background
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
line-height: 36px;
|
| 58 |
-
color: white;
|
| 59 |
-
z-index: 10;
|
| 60 |
-
cursor: pointer;
|
| 61 |
transition: all 0.3s ease;
|
| 62 |
-
border: 1px solid rgba(255, 255, 255, 0.2);
|
| 63 |
}
|
| 64 |
|
| 65 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
position: absolute;
|
| 67 |
-
|
| 68 |
-
left: 10px;
|
| 69 |
-
width: 36px;
|
| 70 |
-
height: 36px;
|
| 71 |
-
background-color: rgba(0, 0, 0, 0.7);
|
| 72 |
border-radius: 50%;
|
| 73 |
text-align: center;
|
| 74 |
-
line-height: 36px;
|
| 75 |
color: white;
|
| 76 |
z-index: 10;
|
| 77 |
cursor: pointer;
|
| 78 |
transition: all 0.3s ease;
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
}
|
| 81 |
|
| 82 |
-
.plyr__video-wrapper .plyr-download-button
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
}
|
| 88 |
|
| 89 |
.plyr__video-wrapper .plyr-download-button:before {
|
| 90 |
font-family: "Font Awesome 5 Free";
|
| 91 |
content: "\f019";
|
| 92 |
font-weight: bold;
|
|
|
|
| 93 |
}
|
| 94 |
|
| 95 |
.plyr__video-wrapper .plyr-share-button:before {
|
| 96 |
font-family: "Font Awesome 5 Free";
|
| 97 |
content: "\f064";
|
| 98 |
font-weight: bold;
|
|
|
|
| 99 |
}
|
| 100 |
|
|
|
|
| 101 |
.plyr, .plyr__video-wrapper, .plyr__video-embed iframe {
|
| 102 |
height: 100%;
|
| 103 |
}
|
| 104 |
|
| 105 |
-
|
| 106 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
}
|
| 108 |
|
| 109 |
-
.
|
| 110 |
-
|
|
|
|
|
|
|
|
|
|
| 111 |
}
|
| 112 |
|
| 113 |
-
.
|
| 114 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
}
|
| 116 |
|
| 117 |
-
.
|
| 118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
}
|
| 120 |
|
| 121 |
-
.
|
| 122 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
}
|
| 124 |
|
| 125 |
-
|
| 126 |
-
|
|
|
|
| 127 |
}
|
| 128 |
|
| 129 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
position: absolute;
|
| 131 |
top: 0;
|
| 132 |
left: 0;
|
| 133 |
width: 100%;
|
| 134 |
-
|
| 135 |
-
background
|
|
|
|
| 136 |
display: flex;
|
| 137 |
align-items: center;
|
| 138 |
-
justify-content: center;
|
| 139 |
-
z-index: 100;
|
| 140 |
opacity: 1;
|
| 141 |
-
transition: opacity 0.
|
|
|
|
| 142 |
}
|
| 143 |
|
| 144 |
-
.
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
|
|
|
|
|
|
| 151 |
}
|
| 152 |
|
| 153 |
-
|
| 154 |
-
|
|
|
|
| 155 |
}
|
| 156 |
|
| 157 |
-
.
|
| 158 |
-
|
| 159 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
}
|
| 161 |
</style>
|
| 162 |
</head>
|
| 163 |
|
| 164 |
<body>
|
| 165 |
-
<div class="
|
| 166 |
-
<div class="loading-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 167 |
</div>
|
| 168 |
-
|
| 169 |
-
<video id="stream-media" controls preload="auto">
|
| 170 |
-
<source src="" type="">
|
| 171 |
-
<p class="vjs-no-js">
|
| 172 |
-
To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video
|
| 173 |
-
</p>
|
| 174 |
-
</video>
|
| 175 |
-
|
| 176 |
-
<div id="error-message"></div>
|
| 177 |
|
| 178 |
<script>
|
| 179 |
// Initialize the player with exact same controls as the original
|
|
@@ -183,23 +355,31 @@
|
|
| 183 |
speed: {selected: 1, options: [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2]},
|
| 184 |
seek: 10,
|
| 185 |
keyboard: { focused: true, global: true },
|
|
|
|
| 186 |
});
|
| 187 |
|
| 188 |
// Hide loading overlay when player is ready
|
| 189 |
player.on('ready', function() {
|
| 190 |
-
|
|
|
|
|
|
|
| 191 |
});
|
| 192 |
|
| 193 |
// This would be replaced with the actual media URL in your template system
|
| 194 |
var mediaLink = "{{ mediaLink }}";
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
|
| 196 |
if (mediaLink) {
|
| 197 |
document.querySelector('#stream-media source').setAttribute('src', mediaLink);
|
| 198 |
player.restart();
|
| 199 |
|
| 200 |
-
// Add download button -
|
| 201 |
var downloadButton = document.createElement('div');
|
| 202 |
-
downloadButton.className = 'plyr-download-button';
|
|
|
|
| 203 |
|
| 204 |
downloadButton.onclick = function(event) {
|
| 205 |
event.stopPropagation();
|
|
@@ -212,17 +392,21 @@
|
|
| 212 |
|
| 213 |
player.elements.container.querySelector('.plyr__video-wrapper').appendChild(downloadButton);
|
| 214 |
|
| 215 |
-
// Add share button -
|
| 216 |
var shareButton = document.createElement('div');
|
| 217 |
-
shareButton.className = 'plyr-share-button';
|
|
|
|
| 218 |
|
| 219 |
shareButton.onclick = function(event) {
|
| 220 |
event.stopPropagation();
|
| 221 |
if (navigator.share) {
|
| 222 |
navigator.share({
|
| 223 |
-
title: "Play",
|
| 224 |
url: mediaLink
|
| 225 |
});
|
|
|
|
|
|
|
|
|
|
| 226 |
}
|
| 227 |
};
|
| 228 |
|
|
@@ -242,6 +426,21 @@
|
|
| 242 |
errorElement.textContent = 'Error: Failed to load media';
|
| 243 |
errorElement.style.display = 'block';
|
| 244 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 245 |
</script>
|
| 246 |
</body>
|
| 247 |
-
</html>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
+
<title>Premium Media Player</title>
|
| 5 |
|
| 6 |
<meta charset="UTF-8">
|
| 7 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
| 9 |
|
| 10 |
<link rel="stylesheet" href="https://cdn.plyr.io/3.7.8/plyr.css" />
|
| 11 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
|
| 12 |
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&display=swap">
|
| 13 |
|
| 14 |
<script src="https://cdn.plyr.io/3.7.8/plyr.polyfilled.js"></script>
|
| 15 |
|
| 16 |
<style>
|
| 17 |
:root {
|
| 18 |
+
--primary-color: #00c6ff;
|
| 19 |
+
--secondary-color: #0072ff;
|
| 20 |
+
--accent-color: #00e676;
|
| 21 |
+
--text-color: #ffffff;
|
| 22 |
+
--background-dark: #111111;
|
| 23 |
+
--background-light: #2a2a2a;
|
| 24 |
+
--overlay-color: rgba(0, 0, 0, 0.7);
|
| 25 |
+
--glow-color: rgba(0, 198, 255, 0.5);
|
| 26 |
}
|
| 27 |
|
| 28 |
html, body {
|
| 29 |
margin: 0;
|
| 30 |
height: 100%;
|
| 31 |
+
font-family: 'Montserrat', sans-serif;
|
| 32 |
+
background-color: var(--background-dark);
|
| 33 |
+
overflow: hidden;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
.player-container {
|
| 37 |
+
position: relative;
|
| 38 |
+
height: 100%;
|
| 39 |
+
width: 100%;
|
| 40 |
}
|
| 41 |
|
| 42 |
#stream-media {
|
|
|
|
| 44 |
width: 100%;
|
| 45 |
}
|
| 46 |
|
| 47 |
+
/* Modern Error Message */
|
| 48 |
#error-message {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
position: absolute;
|
| 50 |
top: 50%;
|
| 51 |
left: 50%;
|
| 52 |
transform: translate(-50%, -50%);
|
| 53 |
+
background: linear-gradient(135deg, #ff416c, #ff4b2b);
|
| 54 |
+
color: white;
|
| 55 |
+
font-size: 18px;
|
| 56 |
+
text-align: center;
|
| 57 |
+
padding: 20px 30px;
|
| 58 |
+
border-radius: 10px;
|
| 59 |
+
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
|
| 60 |
+
z-index: 100;
|
| 61 |
display: none;
|
| 62 |
+
animation: fadeInUp 0.5s ease;
|
| 63 |
+
max-width: 80%;
|
| 64 |
}
|
| 65 |
|
| 66 |
+
/* Redesigned Control Buttons */
|
| 67 |
+
.plyr--full-ui input[type=range] {
|
| 68 |
+
color: var(--primary-color);
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
.plyr__control--overlaid {
|
| 72 |
+
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
|
| 73 |
+
padding: 25px;
|
| 74 |
+
opacity: 0.9;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
transition: all 0.3s ease;
|
|
|
|
| 76 |
}
|
| 77 |
|
| 78 |
+
.plyr__control--overlaid:hover {
|
| 79 |
+
background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
|
| 80 |
+
opacity: 1;
|
| 81 |
+
transform: scale(1.05);
|
| 82 |
+
box-shadow: 0 0 20px var(--glow-color);
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
.plyr--video .plyr__control:hover {
|
| 86 |
+
background: var(--primary-color);
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
.plyr--video .plyr__control.plyr__tab-focus {
|
| 90 |
+
background: var(--primary-color);
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
/* Progress Bar Enhancement */
|
| 94 |
+
.plyr__progress__buffer {
|
| 95 |
+
color: rgba(255, 255, 255, 0.25);
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
.plyr__progress input[type=range]::-webkit-slider-thumb {
|
| 99 |
+
box-shadow: 0 0 10px var(--glow-color);
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
.plyr__progress__container:hover .plyr__progress {
|
| 103 |
+
height: 8px;
|
| 104 |
+
transition: height 0.2s ease;
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
.plyr__progress {
|
| 108 |
+
height: 6px;
|
| 109 |
+
transition: height 0.2s ease;
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
.plyr__volume {
|
| 113 |
+
max-width: initial;
|
| 114 |
+
min-width: initial;
|
| 115 |
+
width: auto;
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
/* Control Bar Styling */
|
| 119 |
+
.plyr--video .plyr__controls {
|
| 120 |
+
background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
|
| 121 |
+
padding: 35px 15px 15px 15px;
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
/* Custom Buttons */
|
| 125 |
+
.plyr__video-wrapper .custom-player-button {
|
| 126 |
position: absolute;
|
| 127 |
+
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
border-radius: 50%;
|
| 129 |
text-align: center;
|
|
|
|
| 130 |
color: white;
|
| 131 |
z-index: 10;
|
| 132 |
cursor: pointer;
|
| 133 |
transition: all 0.3s ease;
|
| 134 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
|
| 135 |
+
border: none;
|
| 136 |
+
width: 44px;
|
| 137 |
+
height: 44px;
|
| 138 |
+
display: flex;
|
| 139 |
+
align-items: center;
|
| 140 |
+
justify-content: center;
|
| 141 |
}
|
| 142 |
|
| 143 |
+
.plyr__video-wrapper .plyr-download-button {
|
| 144 |
+
top: 20px;
|
| 145 |
+
right: 20px;
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
.plyr__video-wrapper .plyr-share-button {
|
| 149 |
+
top: 20px;
|
| 150 |
+
right: 74px;
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
.plyr__video-wrapper .custom-player-button:hover {
|
| 154 |
+
transform: scale(1.1) rotate(5deg);
|
| 155 |
+
box-shadow: 0 0 15px var(--glow-color);
|
| 156 |
}
|
| 157 |
|
| 158 |
.plyr__video-wrapper .plyr-download-button:before {
|
| 159 |
font-family: "Font Awesome 5 Free";
|
| 160 |
content: "\f019";
|
| 161 |
font-weight: bold;
|
| 162 |
+
font-size: 18px;
|
| 163 |
}
|
| 164 |
|
| 165 |
.plyr__video-wrapper .plyr-share-button:before {
|
| 166 |
font-family: "Font Awesome 5 Free";
|
| 167 |
content: "\f064";
|
| 168 |
font-weight: bold;
|
| 169 |
+
font-size: 18px;
|
| 170 |
}
|
| 171 |
|
| 172 |
+
/* Player Height */
|
| 173 |
.plyr, .plyr__video-wrapper, .plyr__video-embed iframe {
|
| 174 |
height: 100%;
|
| 175 |
}
|
| 176 |
|
| 177 |
+
/* Loading Animation */
|
| 178 |
+
.loading-overlay {
|
| 179 |
+
position: absolute;
|
| 180 |
+
top: 0;
|
| 181 |
+
left: 0;
|
| 182 |
+
width: 100%;
|
| 183 |
+
height: 100%;
|
| 184 |
+
background: radial-gradient(circle, rgba(17, 17, 17, 0.9) 0%, rgba(0, 0, 0, 0.95) 100%);
|
| 185 |
+
display: flex;
|
| 186 |
+
flex-direction: column;
|
| 187 |
+
align-items: center;
|
| 188 |
+
justify-content: center;
|
| 189 |
+
z-index: 100;
|
| 190 |
+
opacity: 1;
|
| 191 |
+
transition: opacity 0.5s ease;
|
| 192 |
}
|
| 193 |
|
| 194 |
+
.loading-spinner {
|
| 195 |
+
width: 64px;
|
| 196 |
+
height: 64px;
|
| 197 |
+
margin-bottom: 20px;
|
| 198 |
+
position: relative;
|
| 199 |
}
|
| 200 |
|
| 201 |
+
.loading-spinner:after {
|
| 202 |
+
content: '';
|
| 203 |
+
position: absolute;
|
| 204 |
+
top: 0;
|
| 205 |
+
left: 0;
|
| 206 |
+
width: 100%;
|
| 207 |
+
height: 100%;
|
| 208 |
+
border-radius: 50%;
|
| 209 |
+
border: 3px solid transparent;
|
| 210 |
+
border-top-color: var(--primary-color);
|
| 211 |
+
border-bottom-color: var(--secondary-color);
|
| 212 |
+
animation: spinnerAnimation 1.2s linear infinite;
|
| 213 |
}
|
| 214 |
|
| 215 |
+
.loading-spinner:before {
|
| 216 |
+
content: '';
|
| 217 |
+
position: absolute;
|
| 218 |
+
top: 5px;
|
| 219 |
+
left: 5px;
|
| 220 |
+
right: 5px;
|
| 221 |
+
bottom: 5px;
|
| 222 |
+
border-radius: 50%;
|
| 223 |
+
border: 3px solid transparent;
|
| 224 |
+
border-left-color: var(--accent-color);
|
| 225 |
+
border-right-color: var(--accent-color);
|
| 226 |
+
animation: spinnerAnimation 1.8s linear infinite reverse;
|
| 227 |
}
|
| 228 |
|
| 229 |
+
.loading-text {
|
| 230 |
+
color: var(--text-color);
|
| 231 |
+
font-size: 16px;
|
| 232 |
+
letter-spacing: 2px;
|
| 233 |
+
margin-top: 10px;
|
| 234 |
+
font-weight: 500;
|
| 235 |
+
text-transform: uppercase;
|
| 236 |
+
animation: pulse 1.5s infinite;
|
| 237 |
}
|
| 238 |
|
| 239 |
+
@keyframes spinnerAnimation {
|
| 240 |
+
0% { transform: rotate(0deg); }
|
| 241 |
+
100% { transform: rotate(360deg); }
|
| 242 |
}
|
| 243 |
|
| 244 |
+
@keyframes pulse {
|
| 245 |
+
0%, 100% { opacity: 1; }
|
| 246 |
+
50% { opacity: 0.5; }
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
+
@keyframes fadeInUp {
|
| 250 |
+
from {
|
| 251 |
+
opacity: 0;
|
| 252 |
+
transform: translate(-50%, calc(-50% + 20px));
|
| 253 |
+
}
|
| 254 |
+
to {
|
| 255 |
+
opacity: 1;
|
| 256 |
+
transform: translate(-50%, -50%);
|
| 257 |
+
}
|
| 258 |
+
}
|
| 259 |
+
|
| 260 |
+
.hidden {
|
| 261 |
+
opacity: 0;
|
| 262 |
+
pointer-events: none;
|
| 263 |
+
}
|
| 264 |
+
|
| 265 |
+
/* Video Title */
|
| 266 |
+
.video-title-bar {
|
| 267 |
position: absolute;
|
| 268 |
top: 0;
|
| 269 |
left: 0;
|
| 270 |
width: 100%;
|
| 271 |
+
padding: 15px 20px;
|
| 272 |
+
background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
|
| 273 |
+
z-index: 9;
|
| 274 |
display: flex;
|
| 275 |
align-items: center;
|
|
|
|
|
|
|
| 276 |
opacity: 1;
|
| 277 |
+
transition: opacity 0.3s ease;
|
| 278 |
+
pointer-events: none;
|
| 279 |
}
|
| 280 |
|
| 281 |
+
.video-title {
|
| 282 |
+
color: var(--text-color);
|
| 283 |
+
font-size: 18px;
|
| 284 |
+
font-weight: 600;
|
| 285 |
+
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
|
| 286 |
+
max-width: 80%;
|
| 287 |
+
white-space: nowrap;
|
| 288 |
+
overflow: hidden;
|
| 289 |
+
text-overflow: ellipsis;
|
| 290 |
}
|
| 291 |
|
| 292 |
+
/* Hide title on player interaction */
|
| 293 |
+
.plyr--playing .video-title-bar {
|
| 294 |
+
opacity: 0;
|
| 295 |
}
|
| 296 |
|
| 297 |
+
.plyr--paused .video-title-bar,
|
| 298 |
+
.plyr--playing:hover .video-title-bar {
|
| 299 |
+
opacity: 1;
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
/* Volume Slider Enhancement */
|
| 303 |
+
.plyr__volume input[type=range]::-webkit-slider-thumb {
|
| 304 |
+
box-shadow: 0 0 5px var(--glow-color);
|
| 305 |
+
}
|
| 306 |
+
|
| 307 |
+
/* Menu Container Enhancement */
|
| 308 |
+
.plyr__menu__container {
|
| 309 |
+
background: linear-gradient(135deg, var(--background-light), var(--background-dark));
|
| 310 |
+
border-radius: 8px;
|
| 311 |
+
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
|
| 312 |
+
}
|
| 313 |
+
|
| 314 |
+
.plyr__menu__container .plyr__control {
|
| 315 |
+
color: var(--text-color);
|
| 316 |
+
}
|
| 317 |
+
|
| 318 |
+
.plyr__menu__container .plyr__control--back {
|
| 319 |
+
border-bottom-color: rgba(255, 255, 255, 0.2);
|
| 320 |
+
}
|
| 321 |
+
|
| 322 |
+
.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]::before {
|
| 323 |
+
background: var(--primary-color);
|
| 324 |
+
box-shadow: 0 0 8px var(--glow-color);
|
| 325 |
}
|
| 326 |
</style>
|
| 327 |
</head>
|
| 328 |
|
| 329 |
<body>
|
| 330 |
+
<div class="player-container">
|
| 331 |
+
<div class="loading-overlay" id="loading-overlay">
|
| 332 |
+
<div class="loading-spinner"></div>
|
| 333 |
+
<div class="loading-text">Loading</div>
|
| 334 |
+
</div>
|
| 335 |
+
|
| 336 |
+
<div class="video-title-bar">
|
| 337 |
+
<div class="video-title" id="video-title">Media Player</div>
|
| 338 |
+
</div>
|
| 339 |
+
|
| 340 |
+
<video id="stream-media" controls preload="auto">
|
| 341 |
+
<source src="" type="">
|
| 342 |
+
<p class="vjs-no-js">
|
| 343 |
+
To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video
|
| 344 |
+
</p>
|
| 345 |
+
</video>
|
| 346 |
+
|
| 347 |
+
<div id="error-message"></div>
|
| 348 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 349 |
|
| 350 |
<script>
|
| 351 |
// Initialize the player with exact same controls as the original
|
|
|
|
| 355 |
speed: {selected: 1, options: [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2]},
|
| 356 |
seek: 10,
|
| 357 |
keyboard: { focused: true, global: true },
|
| 358 |
+
tooltips: { controls: true, seek: true },
|
| 359 |
});
|
| 360 |
|
| 361 |
// Hide loading overlay when player is ready
|
| 362 |
player.on('ready', function() {
|
| 363 |
+
setTimeout(function() {
|
| 364 |
+
document.getElementById('loading-overlay').classList.add('hidden');
|
| 365 |
+
}, 500); // Add slight delay for smoother transition
|
| 366 |
});
|
| 367 |
|
| 368 |
// This would be replaced with the actual media URL in your template system
|
| 369 |
var mediaLink = "{{ mediaLink }}";
|
| 370 |
+
var mediaTitle = "{{ mediaTitle || 'Media File' }}";
|
| 371 |
+
|
| 372 |
+
// Update video title
|
| 373 |
+
document.getElementById('video-title').textContent = mediaTitle;
|
| 374 |
|
| 375 |
if (mediaLink) {
|
| 376 |
document.querySelector('#stream-media source').setAttribute('src', mediaLink);
|
| 377 |
player.restart();
|
| 378 |
|
| 379 |
+
// Add download button - with same functionality but enhanced styling
|
| 380 |
var downloadButton = document.createElement('div');
|
| 381 |
+
downloadButton.className = 'custom-player-button plyr-download-button';
|
| 382 |
+
downloadButton.setAttribute('title', 'Download');
|
| 383 |
|
| 384 |
downloadButton.onclick = function(event) {
|
| 385 |
event.stopPropagation();
|
|
|
|
| 392 |
|
| 393 |
player.elements.container.querySelector('.plyr__video-wrapper').appendChild(downloadButton);
|
| 394 |
|
| 395 |
+
// Add share button - with same functionality but enhanced styling
|
| 396 |
var shareButton = document.createElement('div');
|
| 397 |
+
shareButton.className = 'custom-player-button plyr-share-button';
|
| 398 |
+
shareButton.setAttribute('title', 'Share');
|
| 399 |
|
| 400 |
shareButton.onclick = function(event) {
|
| 401 |
event.stopPropagation();
|
| 402 |
if (navigator.share) {
|
| 403 |
navigator.share({
|
| 404 |
+
title: mediaTitle || "Play",
|
| 405 |
url: mediaLink
|
| 406 |
});
|
| 407 |
+
} else {
|
| 408 |
+
// Fallback for browsers that don't support navigator.share
|
| 409 |
+
prompt('Copy this link to share:', mediaLink);
|
| 410 |
}
|
| 411 |
};
|
| 412 |
|
|
|
|
| 426 |
errorElement.textContent = 'Error: Failed to load media';
|
| 427 |
errorElement.style.display = 'block';
|
| 428 |
});
|
| 429 |
+
|
| 430 |
+
// Add some visual feedback for player events
|
| 431 |
+
player.on('play', function() {
|
| 432 |
+
if (player.elements.container.querySelector('.video-title-bar')) {
|
| 433 |
+
setTimeout(function() {
|
| 434 |
+
player.elements.container.querySelector('.video-title-bar').style.opacity = '0';
|
| 435 |
+
}, 1500);
|
| 436 |
+
}
|
| 437 |
+
});
|
| 438 |
+
|
| 439 |
+
player.on('pause', function() {
|
| 440 |
+
if (player.elements.container.querySelector('.video-title-bar')) {
|
| 441 |
+
player.elements.container.querySelector('.video-title-bar').style.opacity = '1';
|
| 442 |
+
}
|
| 443 |
+
});
|
| 444 |
</script>
|
| 445 |
</body>
|
| 446 |
+
</html>
|