![]() 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/-7b4fb6bc/ |
<?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 Status Check</title>
<style>
body {
font-family: 'Inter', sans-serif;
background: #0a0a0a;
color: white;
margin: 0;
padding: 20px;
}
.status-container {
max-width: 1200px;
margin: 0 auto;
background: rgba(255, 255, 255, 0.05);
border-radius: 12px;
padding: 2rem;
border: 1px solid rgba(255, 255, 255, 0.1);
}
.status-section {
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 8px;
padding: 1.5rem;
margin: 1rem 0;
}
.status-item {
display: flex;
align-items: center;
gap: 1rem;
margin: 0.5rem 0;
padding: 0.5rem;
border-radius: 4px;
background: rgba(255, 255, 255, 0.02);
}
.status-icon {
font-size: 1.2rem;
width: 24px;
text-align: center;
}
.status-success { color: #48bb78; }
.status-error { color: #f56565; }
.status-warning { color: #ed8936; }
.status-info { color: #4299e1; }
.test-button {
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
border: none;
padding: 0.8rem 1.5rem;
border-radius: 8px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
margin: 0.5rem;
}
.test-button:hover {
transform: translateY(-2px);
box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}
.log-container {
background: rgba(0, 0, 0, 0.5);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 8px;
padding: 1rem;
margin: 1rem 0;
font-family: monospace;
font-size: 0.9rem;
max-height: 400px;
overflow-y: auto;
white-space: pre-wrap;
}
.track-item {
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 8px;
padding: 1rem;
margin: 0.5rem 0;
cursor: pointer;
transition: all 0.3s ease;
}
.track-item:hover {
background: rgba(255, 255, 255, 0.1);
transform: translateY(-2px);
}
.track-title {
font-weight: 600;
color: #667eea;
}
.track-artist {
color: #a0aec0;
font-size: 0.9rem;
}
.track-url {
color: #718096;
font-size: 0.8rem;
word-break: break-all;
}
</style>
</head>
<body>
<div class="status-container">
<h1>đĩ Global Player Status Check</h1>
<div class="status-section">
<h2>đ§ System Status</h2>
<div id="systemStatus">
<div class="status-item">
<span class="status-icon">âŗ</span>
<span>Checking system status...</span>
</div>
</div>
</div>
<div class="status-section">
<h2>đĩ Global Player Status</h2>
<div id="playerStatus">
<div class="status-item">
<span class="status-icon">âŗ</span>
<span>Checking player status...</span>
</div>
</div>
</div>
<div class="status-section">
<h2>đĩ Test Tracks</h2>
<div id="testTracks">
<div class="track-item" onclick="testTrack('https://apiboxfiles.erweima.ai/MTk4YTg3OGYtM2Y4NS00YWJhLWIxMjMtMjk1OWFjOTUwMDFk.mp3', 'Lounge Lyrics', 'stephane bergeron')">
<div class="track-title">Lounge Lyrics</div>
<div class="track-artist">stephane bergeron</div>
<div class="track-url">apiboxfiles.erweima.ai/MTk4YTg3OGYtM2Y4NS00YWJhLWIxMjMtMjk1OWFjOTUwMDFk.mp3</div>
</div>
<div class="track-item" onclick="testTrack('https://apiboxfiles.erweima.ai/ZTgxN2MwMjItMzQyNC00YzA4LThkZDktMGMzM2NlYjgyZjM0.mp3', 'lounge', 'stephane bergeron')">
<div class="track-title">lounge</div>
<div class="track-artist">stephane bergeron</div>
<div class="track-url">apiboxfiles.erweima.ai/ZTgxN2MwMjItMzQyNC00YzA4LThkZDktMGMzM2NlYjgyZjM0.mp3</div>
</div>
<div class="track-item" onclick="testTrack('https://apiboxfiles.erweima.ai/ZmZiMGZjY2ItYzYxNi00YjI5LWFhNTktOWU0ZDMxYjhlNTY1.mp3', 'Louise\'s Smile', 'stephane bergeron')">
<div class="track-title">Louise's Smile</div>
<div class="track-artist">stephane bergeron</div>
<div class="track-url">apiboxfiles.erweima.ai/ZmZiMGZjY2ItYzYxNi00YjI5LWFhNTktOWU0ZDMxYjhlNTY1.mp3</div>
</div>
</div>
</div>
<div class="status-section">
<h2>đĩ Player Controls Test</h2>
<button class="test-button" onclick="testPlayPause()">Test Play/Pause</button>
<button class="test-button" onclick="testStop()">Test Stop</button>
<button class="test-button" onclick="testNext()">Test Next Track</button>
<button class="test-button" onclick="testPrevious()">Test Previous Track</button>
<button class="test-button" onclick="testVolume()">Test Volume</button>
<button class="test-button" onclick="testProgress()">Test Progress Bar</button>
</div>
<div class="status-section">
<h2>đ Console Logs</h2>
<button class="test-button" onclick="clearLogs()">Clear Logs</button>
<div id="consoleLogs" class="log-container"></div>
</div>
</div>
<script>
// Override console.log to capture debug output
const originalLog = console.log;
const originalError = console.error;
const originalWarn = console.warn;
function logToDisplay(message, type = 'log') {
const logDiv = document.getElementById('consoleLogs');
const timestamp = new Date().toLocaleTimeString();
const prefix = type === 'error' ? 'â' : type === 'warn' ? 'â ī¸' : 'âšī¸';
logDiv.innerHTML += `[${timestamp}] ${prefix} ${message}\n`;
logDiv.scrollTop = logDiv.scrollHeight;
}
console.log = function(...args) {
originalLog.apply(console, args);
logToDisplay(args.join(' '), 'log');
};
console.error = function(...args) {
originalError.apply(console, args);
logToDisplay(args.join(' '), 'error');
};
console.warn = function(...args) {
originalWarn.apply(console, args);
logToDisplay(args.join(' '), 'warn');
};
function updateSystemStatus() {
const statusDiv = document.getElementById('systemStatus');
let html = '';
// Check PHP version
html += `<div class="status-item">
<span class="status-icon status-success">â
</span>
<span>PHP Version: <?php echo PHP_VERSION; ?></span>
</div>`;
// Check if global player file exists
html += `<div class="status-item">
<span class="status-icon status-success">â
</span>
<span>Global Player File: Loaded</span>
</div>`;
// Check if global player element exists
const playerElement = document.getElementById('globalMusicPlayer');
if (playerElement) {
html += `<div class="status-item">
<span class="status-icon status-success">â
</span>
<span>Global Player Element: Found</span>
</div>`;
} else {
html += `<div class="status-item">
<span class="status-icon status-error">â</span>
<span>Global Player Element: Not Found</span>
</div>`;
}
// Check if global player object exists
if (typeof window.globalPlayer !== 'undefined') {
html += `<div class="status-item">
<span class="status-icon status-success">â
</span>
<span>Global Player Object: Available</span>
</div>`;
} else {
html += `<div class="status-item">
<span class="status-icon status-error">â</span>
<span>Global Player Object: Not Available</span>
</div>`;
}
statusDiv.innerHTML = html;
}
function updatePlayerStatus() {
const statusDiv = document.getElementById('playerStatus');
let html = '';
if (typeof window.globalPlayer !== 'undefined') {
const player = window.globalPlayer;
html += `<div class="status-item">
<span class="status-icon status-success">â
</span>
<span>Player Initialized: ${player.initialized ? 'Yes' : 'No'}</span>
</div>`;
html += `<div class="status-item">
<span class="status-icon status-info">âšī¸</span>
<span>Playlist Length: ${player.playlist ? player.playlist.length : 0}</span>
</div>`;
html += `<div class="status-item">
<span class="status-icon status-info">âšī¸</span>
<span>Current Track Index: ${player.currentTrackIndex}</span>
</div>`;
html += `<div class="status-item">
<span class="status-icon status-info">âšī¸</span>
<span>Is Playing: ${player.isPlaying ? 'Yes' : 'No'}</span>
</div>`;
html += `<div class="status-item">
<span class="status-icon status-info">âšī¸</span>
<span>Volume: ${player.volume}</span>
</div>`;
if (player.audio) {
html += `<div class="status-item">
<span class="status-icon status-success">â
</span>
<span>Audio Element: Loaded</span>
</div>`;
html += `<div class="status-item">
<span class="status-icon status-info">âšī¸</span>
<span>Audio Source: ${player.audio.src}</span>
</div>`;
html += `<div class="status-item">
<span class="status-icon status-info">âšī¸</span>
<span>Audio Duration: ${player.audio.duration || 'Unknown'}</span>
</div>`;
} else {
html += `<div class="status-item">
<span class="status-icon status-warning">â ī¸</span>
<span>Audio Element: Not Loaded</span>
</div>`;
}
} else {
html += `<div class="status-item">
<span class="status-icon status-error">â</span>
<span>Global Player: Not Available</span>
</div>`;
}
statusDiv.innerHTML = html;
}
function testTrack(audioUrl, title, artist) {
console.log('đĩ Testing track:', { audioUrl, title, artist });
if (typeof window.playTrackWithGlobalPlayer === 'function') {
window.playTrackWithGlobalPlayer(audioUrl, title, artist);
console.log('đĩ Track test initiated');
} else if (typeof window.globalPlayer !== 'undefined' && window.globalPlayer.playTrack) {
window.globalPlayer.playTrack(audioUrl, title, artist);
console.log('đĩ Track test initiated via direct player');
} else {
console.error('đĩ No player available for testing');
}
// Update status after a delay
setTimeout(updatePlayerStatus, 1000);
}
function testPlayPause() {
console.log('đĩ Testing play/pause');
if (typeof window.globalPlayer !== 'undefined' && window.globalPlayer.togglePlayPause) {
window.globalPlayer.togglePlayPause();
} else {
console.error('đĩ Play/pause function not available');
}
setTimeout(updatePlayerStatus, 500);
}
function testStop() {
console.log('đĩ Testing stop');
if (typeof window.globalPlayer !== 'undefined' && window.globalPlayer.stopTrack) {
window.globalPlayer.stopTrack();
} else {
console.error('đĩ Stop function not available');
}
setTimeout(updatePlayerStatus, 500);
}
function testNext() {
console.log('đĩ Testing next track');
if (typeof window.globalPlayer !== 'undefined' && window.globalPlayer.nextTrack) {
window.globalPlayer.nextTrack();
} else {
console.error('đĩ Next track function not available');
}
setTimeout(updatePlayerStatus, 1000);
}
function testPrevious() {
console.log('đĩ Testing previous track');
if (typeof window.globalPlayer !== 'undefined' && window.globalPlayer.previousTrack) {
window.globalPlayer.previousTrack();
} else {
console.error('đĩ Previous track function not available');
}
setTimeout(updatePlayerStatus, 1000);
}
function testVolume() {
console.log('đĩ Testing volume control');
if (typeof window.globalPlayer !== 'undefined' && window.globalPlayer.setVolume) {
const newVolume = window.globalPlayer.volume === 0.5 ? 0.8 : 0.5;
window.globalPlayer.setVolume(newVolume);
console.log('đĩ Volume set to:', newVolume);
} else {
console.error('đĩ Volume control not available');
}
setTimeout(updatePlayerStatus, 500);
}
function testProgress() {
console.log('đĩ Testing progress bar');
if (typeof window.globalPlayer !== 'undefined' && window.globalPlayer.audio) {
const audio = window.globalPlayer.audio;
if (audio.duration) {
const newTime = audio.currentTime + 30; // Skip 30 seconds
if (newTime < audio.duration) {
audio.currentTime = newTime;
console.log('đĩ Progress set to:', newTime);
} else {
console.log('đĩ Track too short for progress test');
}
} else {
console.log('đĩ Audio duration not available');
}
} else {
console.error('đĩ Progress control not available');
}
}
function clearLogs() {
document.getElementById('consoleLogs').innerHTML = '';
}
// Initialize status check
document.addEventListener('DOMContentLoaded', function() {
console.log('đĩ Global Player Status Check initialized');
// Initial status updates
setTimeout(updateSystemStatus, 100);
setTimeout(updatePlayerStatus, 500);
// Periodic status updates
setInterval(updatePlayerStatus, 5000);
});
// Listen for global player events
window.addEventListener('load', function() {
console.log('đĩ Page loaded, checking global player status');
setTimeout(updatePlayerStatus, 1000);
});
</script>
</body>
</html>