fix comment indentation
This commit is contained in:
parent
523aa2d710
commit
13ac84880b
1 changed files with 5 additions and 5 deletions
10
js/player.js
10
js/player.js
|
|
@ -258,8 +258,8 @@ export class Player {
|
||||||
|
|
||||||
const setHandlers = () => {
|
const setHandlers = () => {
|
||||||
navigator.mediaSession.setActionHandler('play', async () => {
|
navigator.mediaSession.setActionHandler('play', async () => {
|
||||||
// Initialize and resume audio context first (required for iOS lock screen)
|
// Initialize and resume audio context first (required for iOS lock screen)
|
||||||
// Must happen before audio.play() or audio won't route through Web Audio
|
// Must happen before audio.play() or audio won't route through Web Audio
|
||||||
if (!audioContextManager.isReady()) {
|
if (!audioContextManager.isReady()) {
|
||||||
audioContextManager.init(this.audio);
|
audioContextManager.init(this.audio);
|
||||||
this.applyReplayGain();
|
this.applyReplayGain();
|
||||||
|
|
@ -270,7 +270,7 @@ export class Player {
|
||||||
await this.audio.play();
|
await this.audio.play();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('MediaSession play failed:', e);
|
console.error('MediaSession play failed:', e);
|
||||||
// If play fails, try to handle it like a regular play/pause
|
// If play fails, try to handle it like a regular play/pause
|
||||||
this.handlePlayPause();
|
this.handlePlayPause();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -280,7 +280,7 @@ export class Player {
|
||||||
});
|
});
|
||||||
|
|
||||||
navigator.mediaSession.setActionHandler('previoustrack', async () => {
|
navigator.mediaSession.setActionHandler('previoustrack', async () => {
|
||||||
// Ensure audio context is active for iOS lock screen controls
|
// Ensure audio context is active for iOS lock screen controls
|
||||||
if (!audioContextManager.isReady()) {
|
if (!audioContextManager.isReady()) {
|
||||||
audioContextManager.init(this.audio);
|
audioContextManager.init(this.audio);
|
||||||
this.applyReplayGain();
|
this.applyReplayGain();
|
||||||
|
|
@ -290,7 +290,7 @@ export class Player {
|
||||||
});
|
});
|
||||||
|
|
||||||
navigator.mediaSession.setActionHandler('nexttrack', async () => {
|
navigator.mediaSession.setActionHandler('nexttrack', async () => {
|
||||||
// Ensure audio context is active for iOS lock screen controls
|
// Ensure audio context is active for iOS lock screen controls
|
||||||
if (!audioContextManager.isReady()) {
|
if (!audioContextManager.isReady()) {
|
||||||
audioContextManager.init(this.audio);
|
audioContextManager.init(this.audio);
|
||||||
this.applyReplayGain();
|
this.applyReplayGain();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue