jerrrycans commited on
Commit
231fc02
·
verified ·
1 Parent(s): 20da603

Update bot/server/templates/player.html

Browse files
Files changed (1) hide show
  1. bot/server/templates/player.html +54 -113
bot/server/templates/player.html CHANGED
@@ -1,135 +1,93 @@
1
  <!DOCTYPE html>
2
  <html lang="en">
3
  <head>
4
- <title>Modern Media Player</title>
5
 
6
  <meta charset="UTF-8">
7
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
8
  <meta http-equiv="X-Frame-Options" content="deny">
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/6.4.0/css/all.min.css">
12
- <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap" rel="stylesheet">
13
 
14
  <script src="https://cdn.plyr.io/3.7.8/plyr.polyfilled.js"></script>
15
 
16
  <style>
17
- :root {
18
- --primary-color: #4F46E5;
19
- --hover-color: #6366F1;
20
- --text-color: #F9FAFB;
21
- --background-overlay: rgba(17, 24, 39, 0.8);
22
- --background-hover: rgba(79, 70, 229, 0.9);
23
- }
24
-
25
  html, body {
26
  margin: 0;
27
  height: 100%;
28
- font-family: 'Poppins', sans-serif;
29
- background-color: #0F172A;
30
- overflow: hidden;
31
  }
32
 
33
  #stream-media {
34
  height: 100%;
35
  width: 100%;
36
- border-radius: 8px;
37
- box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
38
  }
39
 
40
  #error-message {
41
- color: #EF4444;
42
- font-size: 1.25rem;
43
  text-align: center;
44
- margin-top: 1.25rem;
45
- font-weight: 500;
46
- }
47
-
48
- /* Custom player styling */
49
- .plyr--full-ui input[type=range] {
50
- color: var(--primary-color);
51
  }
52
 
53
- .plyr__control--overlaid {
54
- background: var(--background-overlay);
55
- color: var(--text-color);
56
- transition: background 0.3s ease;
 
 
 
57
  border-radius: 50%;
 
 
 
 
58
  }
59
 
60
- .plyr__control--overlaid:hover {
61
- background: var(--background-hover);
62
- transform: scale(1.1);
63
- }
64
-
65
- .plyr__menu__container {
66
- background: var(--background-overlay);
67
- border-radius: 8px;
68
- }
69
-
70
- .plyr__control {
71
- color: var(--text-color);
72
- }
73
-
74
- .plyr__control:hover {
75
- background: var(--hover-color);
76
  }
77
 
78
- .plyr__control.plyr__tab-focus {
79
- box-shadow: 0 0 0 5px rgba(79, 70, 229, 0.5);
80
- }
81
 
82
- /* Action buttons */
83
- .player-action-button {
84
  position: absolute;
85
- width: 40px;
86
- height: 40px;
87
- background-color: var(--background-overlay);
 
 
88
  border-radius: 50%;
89
- display: flex;
90
- align-items: center;
91
- justify-content: center;
92
- color: var(--text-color);
93
  z-index: 10;
94
- transition: all 0.3s ease;
95
- opacity: 0;
96
- box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
97
- }
98
-
99
- .player-action-button:hover {
100
- background-color: var(--background-hover);
101
- transform: scale(1.1);
102
  }
103
 
104
- .plyr__video-wrapper:hover .player-action-button {
105
- opacity: 1;
 
 
106
  }
107
 
108
- .plyr-download-button {
109
- top: 20px;
110
- right: 20px;
 
111
  }
112
 
113
- .plyr-share-button {
114
- top: 20px;
115
- right: 70px;
 
116
  }
117
 
118
  .plyr, .plyr__video-wrapper, .plyr__video-embed iframe {
119
  height: 100%;
120
- border-radius: 8px;
121
- }
122
-
123
- /* Fix for the empty center element */
124
- .plyr__poster {
125
- background-size: cover !important;
126
- }
127
-
128
- .plyr--video .plyr__controls {
129
- padding: 20px;
130
- background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 100%);
131
- border-radius: 0 0 8px 8px;
132
  }
 
133
  </style>
134
  </head>
135
 
@@ -145,21 +103,11 @@
145
 
146
  <script>
147
  var player = new Plyr('#stream-media', {
148
- controls:['play-large', 'rewind', 'play', 'fast-forward', 'progress', 'current-time', 'mute', 'volume', 'settings', 'pip', 'fullscreen'],
149
- settings:['quality', 'speed', 'loop'],
150
- speed:{selected:1, options:[0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2]},
151
- seekTime: 10,
152
  keyboard: { focused: true, global: true },
153
- hideControls: true,
154
- resetOnEnd: true,
155
- fullscreen: { enabled: true, fallback: true, iosNative: true },
156
- tooltips: { controls: true, seek: true },
157
- });
158
-
159
- // Remove any unwanted elements that might be in the center
160
- player.on('ready', function() {
161
- const unwantedElements = document.querySelectorAll('.plyr__control--overlaid:not(:first-child)');
162
- unwantedElements.forEach(el => el.remove());
163
  });
164
 
165
  var mediaLink = "{{ mediaLink }}";
@@ -169,14 +117,12 @@
169
  player.restart();
170
 
171
  var downloadButton = document.createElement('div');
172
- downloadButton.className = 'player-action-button plyr-download-button';
173
- downloadButton.innerHTML = '<i class="fas fa-download"></i>';
174
 
175
- downloadButton.onclick = function(event) {
176
  event.stopPropagation();
177
  var link = document.createElement('a');
178
  link.href = mediaLink;
179
- link.download = mediaLink.split('/').pop();
180
  document.body.appendChild(link);
181
  link.click();
182
  document.body.removeChild(link);
@@ -185,21 +131,15 @@
185
  player.elements.container.querySelector('.plyr__video-wrapper').appendChild(downloadButton);
186
 
187
  var shareButton = document.createElement('div');
188
- shareButton.className = 'player-action-button plyr-share-button';
189
- shareButton.innerHTML = '<i class="fas fa-share-alt"></i>';
190
 
191
- shareButton.onclick = function(event) {
192
  event.stopPropagation();
193
  if (navigator.share) {
194
  navigator.share({
195
- title: "Modern Media Player",
196
  url: mediaLink
197
  });
198
- } else {
199
- // Fallback for browsers that don't support Web Share API
200
- navigator.clipboard.writeText(mediaLink)
201
- .then(() => alert('Link copied to clipboard!'))
202
- .catch(err => console.error('Could not copy link: ', err));
203
  }
204
  };
205
 
@@ -209,5 +149,6 @@
209
  document.getElementById('error-message').textContent = 'Error: Media URL not provided';
210
  }
211
  </script>
 
212
  </body>
213
- </html>
 
1
  <!DOCTYPE html>
2
  <html lang="en">
3
  <head>
4
+ <title>Play Files</title>
5
 
6
  <meta charset="UTF-8">
7
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
8
  <meta http-equiv="X-Frame-Options" content="deny">
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
  html, body {
17
  margin: 0;
18
  height: 100%;
 
 
 
19
  }
20
 
21
  #stream-media {
22
  height: 100%;
23
  width: 100%;
 
 
24
  }
25
 
26
  #error-message {
27
+ color: red;
28
+ font-size: 24px;
29
  text-align: center;
30
+ margin-top: 20px;
 
 
 
 
 
 
31
  }
32
 
33
+ .plyr__video-wrapper .plyr-download-button{
34
+ position: absolute;
35
+ top: 10px;
36
+ left: 10px;
37
+ width: 30px;
38
+ height: 30px;
39
+ background-color: rgba(0, 0, 0, 0.7);
40
  border-radius: 50%;
41
+ text-align: center;
42
+ line-height: 30px;
43
+ color: white;
44
+ z-index: 10;
45
  }
46
 
47
+ .plyr__volume {
48
+ max-width: initial;
49
+ min-width: initial;
50
+ width: auto;
51
+ position: relative;
 
 
 
 
 
 
 
 
 
 
 
52
  }
53
 
 
 
 
54
 
55
+ .plyr__video-wrapper .plyr-share-button{
 
56
  position: absolute;
57
+ top: 50px;
58
+ left: 10px;
59
+ width: 30px;
60
+ height: 30px;
61
+ background-color: rgba(0, 0, 0, 0.7);
62
  border-radius: 50%;
63
+ text-align: center;
64
+ line-height: 30px;
65
+ color: white;
 
66
  z-index: 10;
 
 
 
 
 
 
 
 
67
  }
68
 
69
+ .plyr__video-wrapper .plyr-download-button:hover,
70
+ .plyr__video-wrapper .plyr-share-button:hover{
71
+ background-color: rgba(255, 255, 255, 0.7);
72
+ color: black;
73
  }
74
 
75
+ .plyr__video-wrapper .plyr-download-button:before {
76
+ font-family: "Font Awesome 5 Free";
77
+ content: "\f019";
78
+ font-weight: bold;
79
  }
80
 
81
+ .plyr__video-wrapper .plyr-share-button:before {
82
+ font-family: "Font Awesome 5 Free";
83
+ content: "\f064";
84
+ font-weight: bold;
85
  }
86
 
87
  .plyr, .plyr__video-wrapper, .plyr__video-embed iframe {
88
  height: 100%;
 
 
 
 
 
 
 
 
 
 
 
 
89
  }
90
+
91
  </style>
92
  </head>
93
 
 
103
 
104
  <script>
105
  var player = new Plyr('#stream-media', {
106
+ controls:['play-large', 'rewind', 'play', 'fast-forward', 'progress', 'current-time', 'mute', 'settings', 'pip', 'fullscreen'],
107
+ settings:['speed','loop'],
108
+ speed:{selected:1,options:[0.25,0.5,0.75,1,1.25,1.5,1.75,2]},
109
+ seek: 10,
110
  keyboard: { focused: true, global: true },
 
 
 
 
 
 
 
 
 
 
111
  });
112
 
113
  var mediaLink = "{{ mediaLink }}";
 
117
  player.restart();
118
 
119
  var downloadButton = document.createElement('div');
120
+ downloadButton.className = 'plyr-download-button';
 
121
 
122
+ downloadButton.onclick = function() {
123
  event.stopPropagation();
124
  var link = document.createElement('a');
125
  link.href = mediaLink;
 
126
  document.body.appendChild(link);
127
  link.click();
128
  document.body.removeChild(link);
 
131
  player.elements.container.querySelector('.plyr__video-wrapper').appendChild(downloadButton);
132
 
133
  var shareButton = document.createElement('div');
134
+ shareButton.className = 'plyr-share-button';
 
135
 
136
+ shareButton.onclick = function() {
137
  event.stopPropagation();
138
  if (navigator.share) {
139
  navigator.share({
140
+ title: "Play",
141
  url: mediaLink
142
  });
 
 
 
 
 
143
  }
144
  };
145
 
 
149
  document.getElementById('error-message').textContent = 'Error: Media URL not provided';
150
  }
151
  </script>
152
+
153
  </body>
154
+ </html>