improved video play
This commit is contained in:
@@ -240,7 +240,14 @@ async function openPlayer(url) {
|
||||
const video = document.getElementById('player');
|
||||
|
||||
// 1. Define isHls (the missing piece!)
|
||||
const streamUrl = `/api/stream?url=${encodeURIComponent(url)}`;
|
||||
let refererParam = '';
|
||||
try {
|
||||
const origin = new URL(url).origin;
|
||||
refererParam = `&referer=${encodeURIComponent(origin + '/')}`;
|
||||
} catch (err) {
|
||||
refererParam = '';
|
||||
}
|
||||
const streamUrl = `/api/stream?url=${encodeURIComponent(url)}${refererParam}`;
|
||||
let isHls = /\.m3u8($|\?)/i.test(url);
|
||||
|
||||
// 2. Cleanup existing player instance to prevent aborted bindings
|
||||
|
||||
Reference in New Issue
Block a user