Debug Cinema Player Issues - Fix Pause Button & Add Autoplay Debugging
This commit is contained in:
parent
184842a8e8
commit
33b6647a76
|
|
@ -193,6 +193,7 @@
|
|||
<div class="panel-header">
|
||||
<h3>Current Playlist</h3>
|
||||
<div class="playlist-controls">
|
||||
<button id="repeat-mode-btn" class="btn btn-mini" title="Repeat: Off">🔁</button>
|
||||
<button id="shuffle-playlist" class="btn btn-mini" title="Shuffle (S)">🔀</button>
|
||||
<button id="clear-playlist" class="btn btn-mini btn-danger">🗑️</button>
|
||||
<button id="save-playlist" class="btn btn-mini">💾</button>
|
||||
|
|
|
|||
|
|
@ -162,11 +162,22 @@ class BaseVideoPlayer {
|
|||
}
|
||||
|
||||
togglePlayPause() {
|
||||
if (!this.videoElement || !this.videoElement.src) {
|
||||
if (!this.videoElement) {
|
||||
console.warn('No video element available');
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if video has a source - either direct src or via source element
|
||||
const hasSource = this.videoElement.src ||
|
||||
(this.videoSource && this.videoSource.src) ||
|
||||
this.currentVideo;
|
||||
|
||||
if (!hasSource) {
|
||||
console.warn('No video loaded');
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('🎬 Toggle play/pause clicked, currently paused:', this.videoElement.paused);
|
||||
if (this.videoElement.paused) {
|
||||
this.play();
|
||||
} else {
|
||||
|
|
@ -177,6 +188,7 @@ class BaseVideoPlayer {
|
|||
play() {
|
||||
if (!this.videoElement) return;
|
||||
|
||||
console.log('🎬 Attempting to play video...');
|
||||
const playPromise = this.videoElement.play();
|
||||
|
||||
if (playPromise !== undefined) {
|
||||
|
|
@ -184,6 +196,7 @@ class BaseVideoPlayer {
|
|||
this.isPlaying = true;
|
||||
this.updatePlayButton();
|
||||
this.hidePlayOverlay();
|
||||
console.log('🎬 Video playing, isPlaying:', this.isPlaying);
|
||||
}).catch(error => {
|
||||
console.error('Error playing video:', error);
|
||||
this.showError('Failed to play video');
|
||||
|
|
@ -194,10 +207,12 @@ class BaseVideoPlayer {
|
|||
pause() {
|
||||
if (!this.videoElement) return;
|
||||
|
||||
console.log('🎬 Attempting to pause video...');
|
||||
this.videoElement.pause();
|
||||
this.isPlaying = false;
|
||||
this.updatePlayButton();
|
||||
this.showPlayOverlay();
|
||||
console.log('🎬 Video paused, isPlaying:', this.isPlaying);
|
||||
}
|
||||
|
||||
seek(seconds) {
|
||||
|
|
@ -323,11 +338,14 @@ class BaseVideoPlayer {
|
|||
|
||||
updatePlayButton() {
|
||||
const playText = this.isPlaying ? '⏸' : '▶';
|
||||
console.log('🎬 Updating play button:', playText, 'isPlaying:', this.isPlaying);
|
||||
if (this.controls.playPause) {
|
||||
this.controls.playPause.textContent = playText;
|
||||
console.log('🎬 Updated main pause button');
|
||||
}
|
||||
if (this.playButtonLarge) {
|
||||
this.playButtonLarge.textContent = playText;
|
||||
console.log('🎬 Updated large play button');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue