![]() 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/-513d391f/ |
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Play Button Fix Test - SoundStudioPro</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
margin: 50px auto;
padding: 20px;
background: #0a0a0a;
color: white;
}
.container {
background: rgba(255, 255, 255, 0.1);
padding: 30px;
border-radius: 15px;
border: 1px solid rgba(255, 255, 255, 0.2);
}
.test-button {
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
border: none;
padding: 15px 30px;
border-radius: 8px;
font-size: 16px;
font-weight: bold;
cursor: pointer;
margin: 10px;
transition: all 0.3s ease;
}
.test-button:hover {
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}
.status {
background: rgba(102, 126, 234, 0.1);
border: 1px solid rgba(102, 126, 234, 0.3);
padding: 20px;
border-radius: 8px;
margin: 20px 0;
}
.success {
background: rgba(72, 187, 120, 0.1);
border: 1px solid #48bb78;
color: #48bb78;
}
.error {
background: rgba(245, 101, 101, 0.1);
border: 1px solid #f56565;
color: #f56565;
}
.track-card {
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 12px;
padding: 20px;
margin: 20px 0;
}
.track-info {
margin-bottom: 15px;
}
.track-actions {
display: flex;
gap: 10px;
}
</style>
</head>
<body>
<div class="container">
<h1>๐ง Play Button Fix Test</h1>
<div class="status" id="status">
<h3>๐ Test Status</h3>
<div id="statusContent">Checking global player functions...</div>
</div>
<div style="text-align: center;">
<button class="test-button" onclick="testGlobalPlayer()">๐งช Test Global Player</button>
<button class="test-button" onclick="testPlayButton()">๐ต Test Play Button</button>
<button class="test-button" onclick="testCommunityPage()">๐ Test Community Page</button>
</div>
<div class="track-card">
<div class="track-info">
<h3>Test Track - Lounge Lyrics</h3>
<p>Sample track to test play functionality</p>
<p><strong>Duration:</strong> 3:09 | <strong>Artist:</strong> SoundStudioPro</p>
</div>
<div class="track-actions">
<button class="test-button play-track-btn"
data-audio-url="https://apiboxfiles.erweima.ai/MTk4YTg3OGYtM2Y4NS00YWJhLWIxMjMtMjk1OWFjOTUwMDFk.mp3"
data-title="Lounge Lyrics - Test Track"
data-artist="SoundStudioPro"
data-track-id="999">
<i class="fas fa-play"></i> Play
</button>
<button class="test-button" onclick="testDirectPlay()">
<i class="fas fa-play"></i> Direct Play
</button>
</div>
</div>
</div>
<script>
// Test global player functions
function testGlobalPlayer() {
const statusDiv = document.getElementById('statusContent');
let status = '';
// Check if global player exists
if (typeof window.globalPlayer !== 'undefined') {
status += 'โ
Global player object exists<br>';
} else {
status += 'โ Global player object missing<br>';
}
// Check if playTrackWithGlobalPlayer exists
if (typeof window.playTrackWithGlobalPlayer === 'function') {
status += 'โ
playTrackWithGlobalPlayer function exists<br>';
} else {
status += 'โ playTrackWithGlobalPlayer function missing<br>';
}
// Check if global player element exists
if (document.getElementById('globalMusicPlayer')) {
status += 'โ
Global player element exists<br>';
} else {
status += 'โ Global player element missing<br>';
}
statusDiv.innerHTML = status;
if (status.includes('โ')) {
document.getElementById('status').className = 'status error';
} else {
document.getElementById('status').className = 'status success';
}
}
// Test play button functionality
function testPlayButton() {
console.log('๐ต Testing play button functionality...');
const playButtons = document.querySelectorAll('.play-track-btn');
console.log('๐ต Found play buttons:', playButtons.length);
playButtons.forEach((button, index) => {
console.log(`๐ต Button ${index + 1}:`, {
audioUrl: button.getAttribute('data-audio-url'),
title: button.getAttribute('data-title'),
artist: button.getAttribute('data-artist'),
trackId: button.getAttribute('data-track-id')
});
// Test clicking the button
button.click();
});
}
// Test direct play function
async function testDirectPlay() {
console.log('๐ต Testing direct play...');
const audioUrl = 'https://apiboxfiles.erweima.ai/MTk4YTg3OGYtM2Y4NS00YWJhLWIxMjMtMjk1OWFjOTUwMDFk.mp3';
const title = 'Lounge Lyrics - Test Track';
const artist = 'SoundStudioPro';
if (typeof window.playTrackWithGlobalPlayer === 'function') {
console.log('๐ต Calling playTrackWithGlobalPlayer...');
const success = await window.playTrackWithGlobalPlayer(audioUrl, title, artist);
console.log('๐ต Play result:', success);
if (success) {
alert('โ
Track should be playing in global player!');
} else {
alert('โ Failed to play track');
}
} else {
alert('โ playTrackWithGlobalPlayer function not available');
}
}
// Test community page style play button
function testCommunityPage() {
console.log('๐ต Testing community page style play button...');
// Simulate the community page event listener
document.querySelectorAll('.play-track-btn').forEach(button => {
button.addEventListener('click', function(e) {
e.preventDefault();
e.stopPropagation();
e.stopImmediatePropagation();
const audioUrl = this.getAttribute('data-audio-url');
const title = this.getAttribute('data-title');
const artist = this.getAttribute('data-artist');
const trackId = this.getAttribute('data-track-id');
console.log('๐ต Community style play button clicked:', { audioUrl, title, artist, trackId });
// Record the play (simulate)
console.log('๐ต Recording play for track ID:', trackId);
// Play the track
if (typeof window.playTrackWithGlobalPlayer === 'function') {
window.playTrackWithGlobalPlayer(audioUrl, title, artist);
}
});
});
alert('๐ต Community page style event listeners added. Click the play button to test.');
}
// Check status on page load
window.addEventListener('load', function() {
console.log('๐ต Test page loaded');
testGlobalPlayer();
});
</script>
</body>
</html>