mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-11 17:30:00 +02:00
feat: Add initial IPTV player with HLS/MPEG-TS support, query parameter parsing, and parent window communication.
This commit is contained in:
1 parent
3cf848c526
commit
5b1cd36737
5 files changed
+138
-11
No files matched your search
+20
-4
@@ -182,17 +182,33 @@
|
||||
video.style.objectFit = 'contain';
|
||||
}
|
||||
} else if (data.type === 'set_audio_track') {
|
||||
// Not standard in HTML5 Video API across all browsers universally for MP4
|
||||
// But HLS.js and mpegts.js have specific APIs.
|
||||
// For native "video.audioTracks", it is experimental.
|
||||
// We will try to handle HLS.js switching if active.
|
||||
log('Switching audio track index: ' + data.index);
|
||||
if (window.hlsInstance) {
|
||||
window.hlsInstance.audioTrack = data.index;
|
||||
}
|
||||
} else if (data.type === 'play') {
|
||||
log('Received play command');
|
||||
video.play().catch(e => log('Play failed: ' + e));
|
||||
} else if (data.type === 'pause') {
|
||||
log('Received pause command');
|
||||
video.pause();
|
||||
} else if (data.type === 'seek') {
|
||||
log('Seeking to: ' + data.value);
|
||||
if (isFinite(data.value)) {
|
||||
video.currentTime = data.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Notify parent about playback state changes
|
||||
video.addEventListener('play', () => {
|
||||
window.parent.postMessage({ type: 'playback_status', status: 'playing' }, '*');
|
||||
});
|
||||
video.addEventListener('pause', () => {
|
||||
window.parent.postMessage({ type: 'playback_status', status: 'paused' }, '*');
|
||||
});
|
||||
|
||||
|
||||
// Report available audio tracks
|
||||
function reportAudioTracks() {
|
||||
let tracks = [];
|
||||
|
||||
Reference in new issue
Block a user