mirror of
https://github.com/navidrome/navidrome.git
synced 2026-05-03 06:51:16 +00:00
Fix APlayer instance scope in initialization
Refactored APlayer initialization to use a properly scoped variable for the instance, ensuring it is accessible outside the try block. This improves logging and debugging of the APlayer instance after creation.
This commit is contained in:
parent
e251421fb8
commit
08b5e3bc85
@ -76,9 +76,10 @@
|
||||
console.log('Container styles:', window.getComputedStyle(container));
|
||||
|
||||
console.log('Creating APlayer with playlist:', playlist);
|
||||
|
||||
|
||||
let ap;
|
||||
try {
|
||||
const ap = new APlayer({
|
||||
ap = new APlayer({
|
||||
container: container,
|
||||
lrcType: 0,
|
||||
audio: playlist,
|
||||
@ -98,19 +99,19 @@
|
||||
// Log initialization
|
||||
console.log('APlayer initialized with', playlist.length, 'tracks');
|
||||
console.log('APlayer instance:', ap);
|
||||
|
||||
|
||||
// Check if APlayer created DOM elements
|
||||
setTimeout(() => {
|
||||
const aplayerElements = container.querySelectorAll('*');
|
||||
console.log('APlayer created', aplayerElements.length, 'child elements');
|
||||
|
||||
|
||||
if (aplayerElements.length === 0) {
|
||||
console.error('APlayer did not create any child elements - initialization failed');
|
||||
} else {
|
||||
console.log('APlayer child elements:', aplayerElements);
|
||||
}
|
||||
}, 100);
|
||||
|
||||
|
||||
} catch (error) {
|
||||
console.error('APlayer initialization failed:', error);
|
||||
return;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user