![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/.cursor-server/data/User/History/-2da9781b/ |
<?php
session_start();
$page_title = 'Debug Global Player Simple';
$current_page = 'test';
include 'includes/header.php';
?>
<div style="padding: 2rem; color: white;">
<h1>🔧 Debug Global Player - Simple</h1>
<div style="margin: 2rem 0;">
<h2>Test Buttons:</h2>
<button onclick="checkGlobalPlayer()" style="padding: 1rem 2rem; margin: 0.5rem; background: #667eea; color: white; border: none; border-radius: 8px; cursor: pointer;">
🔍 Check Global Player
</button>
<button onclick="forceInit()" style="padding: 1rem 2rem; margin: 0.5rem; background: #48bb78; color: white; border: none; border-radius: 8px; cursor: pointer;">
⚡ Force Initialize
</button>
<button onclick="testPlay()" style="padding: 1rem 2rem; margin: 0.5rem; background: #f56565; color: white; border: none; border-radius: 8px; cursor: pointer;">
🎵 Test Play
</button>
</div>
<div style="margin: 2rem 0;">
<h2>Debug Info:</h2>
<div id="debugInfo" style="background: rgba(255,255,255,0.1); padding: 1rem; border-radius: 8px; font-family: monospace; white-space: pre-wrap;">
Loading...
</div>
</div>
</div>
<script>
function checkGlobalPlayer() {
console.log('🎵 Checking global player...');
const info = {
'enhancedGlobalPlayer exists': !!window.enhancedGlobalPlayer,
'globalPlayerReady': !!window.globalPlayerReady,
'playTrack function': !!(window.enhancedGlobalPlayer && window.enhancedGlobalPlayer.playTrack),
'showPlayer function': !!(window.enhancedGlobalPlayer && window.enhancedGlobalPlayer.showPlayer),
'loadPlaylist function': !!(window.enhancedGlobalPlayer && window.enhancedGlobalPlayer.loadPlaylist),
'waitForGlobalPlayer function': !!window.waitForGlobalPlayer,
'Player element exists': !!document.getElementById('enhancedGlobalPlayer'),
'Audio element exists': !!document.getElementById('globalAudioElement'),
'Player element visible': !!(document.getElementById('enhancedGlobalPlayer') && document.getElementById('enhancedGlobalPlayer').offsetParent !== null)
};
const debugDiv = document.getElementById('debugInfo');
debugDiv.innerHTML = Object.entries(info)
.map(([key, value]) => `${key}: ${value ? '✅' : '❌'}`)
.join('\n');
console.log('🎵 Player status:', info);
if (window.enhancedGlobalPlayer) {
console.log('🎵 Available functions:', Object.keys(window.enhancedGlobalPlayer));
}
}
function forceInit() {
console.log('🎵 Forcing initialization...');
if (window.enhancedGlobalPlayer && window.enhancedGlobalPlayer.init) {
try {
window.enhancedGlobalPlayer.init();
console.log('✅ Forced initialization successful');
alert('✅ Forced initialization successful!');
} catch (error) {
console.error('❌ Forced initialization failed:', error);
alert('❌ Forced initialization failed: ' + error.message);
}
} else {
console.error('❌ Init function not available');
alert('❌ Init function not available');
}
}
function testPlay() {
console.log('🎵 Testing play...');
if (window.enhancedGlobalPlayer && typeof window.enhancedGlobalPlayer.playTrack === 'function') {
try {
window.enhancedGlobalPlayer.playTrack(
'https://soundstudiopro.com/assets/audio/sample-track.mp3',
'Test Track',
'Test Artist',
999
);
console.log('✅ Play test successful');
alert('✅ Play test successful!');
} catch (error) {
console.error('❌ Play test failed:', error);
alert('❌ Play test failed: ' + error.message);
}
} else {
console.error('❌ PlayTrack function not available');
alert('❌ PlayTrack function not available');
}
}
// Check immediately
checkGlobalPlayer();
// Check when DOM is loaded
document.addEventListener('DOMContentLoaded', function() {
console.log('🎵 DOM loaded');
setTimeout(checkGlobalPlayer, 1000);
});
// Check when page is fully loaded
window.addEventListener('load', function() {
console.log('🎵 Page fully loaded');
setTimeout(checkGlobalPlayer, 2000);
});
// Monitor for global player
let checkCount = 0;
const maxChecks = 20;
const checkInterval = setInterval(() => {
checkCount++;
console.log(`🎵 Check ${checkCount}: Global player status`);
if (window.enhancedGlobalPlayer) {
console.log('✅ Global player detected!');
clearInterval(checkInterval);
checkGlobalPlayer();
} else if (checkCount >= maxChecks) {
console.error('❌ Global player not detected after maximum checks');
clearInterval(checkInterval);
checkGlobalPlayer();
}
}, 500);
</script>
<?php include 'includes/footer.php'; ?>