![]() 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();
include 'includes/header.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Global Player Test</title>
<style>
body {
font-family: 'Inter', sans-serif;
background: #0a0a0a;
color: white;
padding: 2rem;
}
.test-section {
background: rgba(255, 255, 255, 0.05);
border-radius: 12px;
padding: 2rem;
margin: 2rem 0;
border: 1px solid rgba(255, 255, 255, 0.1);
}
.test-button {
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
border: none;
padding: 1rem 2rem;
border-radius: 8px;
font-size: 1.4rem;
font-weight: 600;
cursor: pointer;
margin: 0.5rem;
transition: all 0.3s ease;
}
.test-button:hover {
transform: translateY(-2px);
box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}
.log {
background: rgba(0, 0, 0, 0.3);
border-radius: 8px;
padding: 1rem;
margin: 1rem 0;
font-family: monospace;
font-size: 1.2rem;
max-height: 300px;
overflow-y: auto;
}
.status {
padding: 1rem;
border-radius: 8px;
margin: 1rem 0;
font-weight: 600;
}
.status.success { background: rgba(72, 187, 120, 0.2); border: 1px solid #48bb78; }
.status.error { background: rgba(245, 101, 101, 0.2); border: 1px solid #f56565; }
.status.warning { background: rgba(237, 137, 54, 0.2); border: 1px solid #ed8936; }
</style>
</head>
<body>
<h1>🎵 Global Player Test</h1>
<div class="test-section">
<h2>Player Status</h2>
<div id="playerStatus" class="status">Checking player status...</div>
<div id="playerLog" class="log"></div>
</div>
<div class="test-section">
<h2>Test Controls</h2>
<button class="test-button" onclick="testPlayButton()">Test Play Button</button>
<button class="test-button" onclick="testLoadTrack()">Test Load Track</button>
<button class="test-button" onclick="testPlayTrack()">Test Play Track</button>
<button class="test-button" onclick="testGlobalFunction()">Test Global Function</button>
<button class="test-button" onclick="clearLog()">Clear Log</button>
</div>
<div class="test-section">
<h2>Manual Test</h2>
<p>Try clicking the play button in the global player at the bottom of the page.</p>
<p>Check the browser console (F12) for any error messages.</p>
</div>
<script>
function log(message, type = 'info') {
const logDiv = document.getElementById('playerLog');
const timestamp = new Date().toLocaleTimeString();
logDiv.innerHTML += `[${timestamp}] ${message}<br>`;
logDiv.scrollTop = logDiv.scrollHeight;
console.log(`🎵 ${message}`);
}
function updateStatus(message, type = 'info') {
const statusDiv = document.getElementById('playerStatus');
statusDiv.textContent = message;
statusDiv.className = `status ${type}`;
}
function testPlayButton() {
log('Testing play button...');
const playBtn = document.getElementById('globalPlayBtn');
if (playBtn) {
log('✅ Play button found');
playBtn.click();
log('✅ Play button clicked');
} else {
log('❌ Play button not found');
updateStatus('Play button not found', 'error');
}
}
function testLoadTrack() {
log('Testing load track...');
if (typeof window.globalPlayer !== 'undefined') {
log('✅ Global player exists');
if (typeof window.globalPlayer.playTrack === 'function') {
log('✅ playTrack function exists');
const testUrl = 'https://apiboxfiles.erweima.ai/MTk4YTg3OGYtM2Y4NS00YWJhLWIxMjMtMjk1OWFjOTUwMDFk.mp3';
window.globalPlayer.playTrack(testUrl, 'Test Track', 'Test Artist');
log('✅ Track loaded');
} else {
log('❌ playTrack function not found');
updateStatus('playTrack function not found', 'error');
}
} else {
log('❌ Global player not found');
updateStatus('Global player not found', 'error');
}
}
function testPlayTrack() {
log('Testing play track...');
if (typeof window.globalPlayer !== 'undefined') {
log('✅ Global player exists');
if (typeof window.globalPlayer.togglePlayPause === 'function') {
log('✅ togglePlayPause function exists');
window.globalPlayer.togglePlayPause();
log('✅ togglePlayPause called');
} else {
log('❌ togglePlayPause function not found');
updateStatus('togglePlayPause function not found', 'error');
}
} else {
log('❌ Global player not found');
updateStatus('Global player not found', 'error');
}
}
function testGlobalFunction() {
log('Testing global function...');
if (typeof window.playTrackWithGlobalPlayer === 'function') {
log('✅ playTrackWithGlobalPlayer function exists');
const testUrl = 'https://apiboxfiles.erweima.ai/MTk4YTg3OGYtM2Y4NS00YWJhLWIxMjMtMjk1OWFjOTUwMDFk.mp3';
window.playTrackWithGlobalPlayer(testUrl, 'Test Track', 'Test Artist');
log('✅ Global function called');
} else {
log('❌ playTrackWithGlobalPlayer function not found');
updateStatus('Global function not found', 'error');
}
}
function clearLog() {
document.getElementById('playerLog').innerHTML = '';
}
// Check player status on load
window.addEventListener('load', function() {
log('Page loaded, checking player status...');
setTimeout(() => {
if (typeof window.globalPlayer !== 'undefined') {
log('✅ Global player object exists');
updateStatus('Global player loaded', 'success');
if (window.globalPlayer.initialized) {
log('✅ Global player initialized');
} else {
log('⚠️ Global player not initialized');
updateStatus('Global player not initialized', 'warning');
}
if (typeof window.globalPlayer.playTrack === 'function') {
log('✅ playTrack function exists');
} else {
log('❌ playTrack function missing');
updateStatus('playTrack function missing', 'error');
}
if (typeof window.globalPlayer.togglePlayPause === 'function') {
log('✅ togglePlayPause function exists');
} else {
log('❌ togglePlayPause function missing');
updateStatus('togglePlayPause function missing', 'error');
}
} else {
log('❌ Global player object not found');
updateStatus('Global player not found', 'error');
}
}, 2000);
});
</script>
<?php include 'includes/global_player.php'; ?>
</body>
</html>