![]() 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';
include 'includes/global_player.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 Simple Test</title>
<style>
body {
font-family: Arial, sans-serif;
padding: 20px;
background: #f5f5f5;
}
.test-container {
background: white;
padding: 20px;
border-radius: 8px;
margin-bottom: 20px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.test-button {
background: #007bff;
color: white;
border: none;
padding: 10px 20px;
border-radius: 4px;
cursor: pointer;
margin: 5px;
}
.test-button:hover {
background: #0056b3;
}
.status {
padding: 10px;
margin: 10px 0;
border-radius: 4px;
}
.success { background: #d4edda; color: #155724; }
.error { background: #f8d7da; color: #721c24; }
.warning { background: #fff3cd; color: #856404; }
.info { background: #d1ecf1; color: #0c5460; }
</style>
</head>
<body>
<h1>Global Player Simple Test</h1>
<div class="test-container">
<h2>Test Instructions</h2>
<ol>
<li>Wait for the global player to load at the bottom of the page</li>
<li>Click the "Test Play Button" below to test the play functionality</li>
<li>Check if the global player starts playing</li>
<li>Use the global player controls to test pause, next, previous, etc.</li>
</ol>
</div>
<div class="test-container">
<h2>Test Controls</h2>
<button class="test-button" onclick="testPlayButton()">Test Play Button</button>
<button class="test-button" onclick="testPlayTrack()">Test Play Track</button>
<button class="test-button" onclick="checkPlayerStatus()">Check Player Status</button>
</div>
<div class="test-container">
<h2>Status</h2>
<div id="status">Checking...</div>
</div>
<?php include 'includes/global_player.php'; ?>
<script>
function updateStatus(message, type = 'info') {
const statusDiv = document.getElementById('status');
statusDiv.innerHTML = `<div class="status ${type}">${message}</div>`;
}
function testPlayButton() {
console.log('Testing play button...');
updateStatus('Testing play button...', 'info');
const playBtn = document.getElementById('globalPlayBtn');
if (playBtn) {
console.log('Play button found, clicking...');
playBtn.click();
updateStatus('Play button clicked - check if audio starts playing', 'success');
} else {
console.error('Play button not found');
updateStatus('Play button not found!', 'error');
}
}
function testPlayTrack() {
console.log('Testing playTrack function...');
updateStatus('Testing playTrack function...', 'info');
if (window.globalPlayer && typeof window.globalPlayer.playTrack === 'function') {
const testTrack = {
audio_url: 'https://apiboxfiles.erweima.ai/MTk4YTg3OGYtM2Y4NS00YWJhLWIxMjMtMjk1OWFjOTUwMDFk.mp3',
title: 'Test Track',
artist_name: 'Test Artist'
};
console.log('Playing test track:', testTrack);
window.globalPlayer.playTrack(testTrack.audio_url, testTrack.title, testTrack.artist_name);
updateStatus('Test track loaded - click play button to start', 'success');
} else {
console.error('playTrack function not found');
updateStatus('playTrack function not found!', 'error');
}
}
function checkPlayerStatus() {
console.log('Checking player status...');
if (typeof window.globalPlayer === 'undefined') {
updateStatus('❌ Global player not found', 'error');
return;
}
let status = '✅ Global player exists<br>';
if (window.globalPlayer.initialized) {
status += '✅ Global player is initialized<br>';
} else {
status += '⚠️ Global player is NOT initialized<br>';
}
if (window.globalPlayer.audio) {
status += '✅ Audio element exists<br>';
status += `🎵 Audio src: ${window.globalPlayer.audio.src}<br>`;
status += `🎵 Audio paused: ${window.globalPlayer.audio.paused}<br>`;
status += `🎵 Audio readyState: ${window.globalPlayer.audio.readyState}<br>`;
} else {
status += '⚠️ No audio element<br>';
}
if (window.globalPlayer.playlist && window.globalPlayer.playlist.length > 0) {
status += `✅ Playlist has ${window.globalPlayer.playlist.length} tracks<br>`;
} else {
status += '⚠️ No playlist<br>';
}
status += `🎵 Is playing: ${window.globalPlayer.isPlaying}<br>`;
status += `🎵 Current track index: ${window.globalPlayer.currentTrackIndex}`;
updateStatus(status, 'info');
}
// Check status on page load
window.addEventListener('load', function() {
console.log('Page loaded, checking global player...');
setTimeout(checkPlayerStatus, 1000);
});
// Update status every 5 seconds
setInterval(checkPlayerStatus, 5000);
</script>
</body>
</html>