49 lines
1.8 KiB
JavaScript
49 lines
1.8 KiB
JavaScript
// Debug script to test video player integration
|
|
console.log('🔍 Testing video player integration...');
|
|
|
|
// Test if button exists
|
|
const videoBtn = document.getElementById('manage-video-btn');
|
|
console.log('Video button exists:', !!videoBtn);
|
|
|
|
// Test if video management screen exists
|
|
const videoScreen = document.getElementById('video-management-screen');
|
|
console.log('Video management screen exists:', !!videoScreen);
|
|
|
|
// Test if VideoPlayerManager class is available
|
|
console.log('VideoPlayerManager class available:', typeof window.VideoPlayerManager !== 'undefined');
|
|
|
|
// Test if showScreen function is available
|
|
console.log('showScreen function available:', typeof window.game?.showScreen === 'function');
|
|
|
|
// Manual button click test
|
|
if (videoBtn) {
|
|
console.log('✅ Button found, adding click test...');
|
|
videoBtn.addEventListener('click', () => {
|
|
console.log('🎬 Video button clicked!');
|
|
|
|
// Try to show the video management screen
|
|
if (window.game && typeof window.game.showScreen === 'function') {
|
|
console.log('Calling showScreen...');
|
|
window.game.showScreen('video-management-screen');
|
|
} else {
|
|
console.error('❌ showScreen function not available');
|
|
}
|
|
});
|
|
} else {
|
|
console.error('❌ Video button not found');
|
|
}
|
|
|
|
// Test function directly
|
|
function testVideoScreen() {
|
|
console.log('🧪 Testing direct screen switch...');
|
|
if (window.game && typeof window.game.showScreen === 'function') {
|
|
window.game.showScreen('video-management-screen');
|
|
} else {
|
|
console.error('❌ Game instance or showScreen not available');
|
|
}
|
|
}
|
|
|
|
// Make test function available globally
|
|
window.testVideoScreen = testVideoScreen;
|
|
|
|
console.log('✅ Debug script loaded. Try: window.testVideoScreen()'); |