![]() 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/3c9b6b63/ |
<?php
session_start();
// Check if user is logged in
if (!isset($_SESSION['user_id'])) {
header('Location: /auth/login.php');
exit;
}
$page_title = 'Simple Global Player Test - SoundStudioPro';
$current_page = 'test';
include 'includes/header.php';
?>
<div style="padding: 2rem; color: white; background: #0a0a0a; min-height: 100vh;">
<h1>🎵 Simple Global Player Test</h1>
<div style="margin: 2rem 0; padding: 2rem; background: rgba(255,255,255,0.1); border-radius: 12px;">
<h2>Global Player Status</h2>
<div id="playerStatus">Checking...</div>
</div>
<div style="margin: 2rem 0; padding: 2rem; background: rgba(255,255,255,0.1); border-radius: 12px;">
<h2>Test Play Button</h2>
<button onclick="testPlay()" style="background: #667eea; color: white; padding: 1rem 2rem; border: none; border-radius: 8px; cursor: pointer;">
🎵 Test Play
</button>
</div>
<div style="margin: 2rem 0; padding: 2rem; background: rgba(255,255,255,0.1); border-radius: 12px;">
<h2>Console Output</h2>
<div id="consoleOutput">Check browser console for logs...</div>
</div>
</div>
<script>
function updateStatus() {
const statusDiv = document.getElementById('playerStatus');
const consoleDiv = document.getElementById('consoleOutput');
let status = '<h3>Global Player Status:</h3>';
let consoleText = '';
// Check if global player exists
if (typeof window.globalPlayer !== 'undefined') {
status += '<p>✅ Global player object exists</p>';
consoleText += '✅ Global player object exists\n';
// Check if it has required methods
if (typeof window.globalPlayer.playTrack === 'function') {
status += '<p>✅ playTrack method exists</p>';
consoleText += '✅ playTrack method exists\n';
} else {
status += '<p>❌ playTrack method missing</p>';
consoleText += '❌ playTrack method missing\n';
}
if (typeof window.globalPlayer.init === 'function') {
status += '<p>✅ init method exists</p>';
consoleText += '✅ init method exists\n';
} else {
status += '<p>❌ init method missing</p>';
consoleText += '❌ init method missing\n';
}
if (typeof window.globalPlayer.loadCommunityPlaylist === 'function') {
status += '<p>✅ loadCommunityPlaylist method exists</p>';
consoleText += '✅ loadCommunityPlaylist method exists\n';
} else {
status += '<p>❌ loadCommunityPlaylist method missing</p>';
consoleText += '❌ loadCommunityPlaylist method missing\n';
}
// Check initialization status
status += `<p>Initialized: ${window.globalPlayer.initialized ? '✅ Yes' : '❌ No'}</p>`;
consoleText += `Initialized: ${window.globalPlayer.initialized ? '✅ Yes' : '❌ No'}\n`;
// Check playlist
status += `<p>Playlist length: ${window.globalPlayer.playlist ? window.globalPlayer.playlist.length : 'N/A'}</p>`;
consoleText += `Playlist length: ${window.globalPlayer.playlist ? window.globalPlayer.playlist.length : 'N/A'}\n`;
} else {
status += '<p>❌ Global player object not found</p>';
consoleText += '❌ Global player object not found\n';
}
statusDiv.innerHTML = status;
consoleDiv.innerHTML = consoleText.replace(/\n/g, '<br>');
}
function testPlay() {
console.log('🎵 Testing play function...');
if (typeof window.globalPlayer === 'undefined') {
alert('Global player not found!');
return;
}
if (typeof window.globalPlayer.playTrack !== 'function') {
alert('playTrack method not found!');
return;
}
// Test with a sample track
const testUrl = 'https://apiboxfiles.erweima.ai/ZTljY2U4ZGMtZWQyMC00ZmQwLWIyZTQtNTk0MWJlZTdhNDli.mp3';
const testTitle = 'Test Track';
const testArtist = 'Test Artist';
console.log('🎵 Calling playTrack with test data...');
try {
window.globalPlayer.playTrack(testUrl, testTitle, testArtist);
alert('Play function called successfully!');
} catch (error) {
console.error('🎵 Play error:', error);
alert('Play function error: ' + error.message);
}
}
// Check status on load and every 2 seconds
document.addEventListener('DOMContentLoaded', function() {
console.log('🎵 Simple test page loaded');
updateStatus();
// Update status every 2 seconds
setInterval(updateStatus, 2000);
});
</script>
<?php include 'includes/footer.php'; ?>