FIX: Firefox playback and button feedback
- Fix Firefox DASH playback errors (NS_ERROR_FAILURE) by using attachSource instead of re-initializing the player. - Ensure dashPlayer is properly reset when switching to local files. - Add hover brightness and active scale effects to primary and secondary buttons for better visual feedback.
This commit is contained in:
parent
5d25e3ca63
commit
241b72f43b
2 changed files with 22 additions and 4 deletions
14
js/player.js
14
js/player.js
|
|
@ -282,7 +282,10 @@ export class Player {
|
|||
let streamUrl;
|
||||
|
||||
if (track.isLocal && track.file) {
|
||||
this.dashPlayer.reset(); // Ensure dash is off
|
||||
if (this.dashInitialized) {
|
||||
this.dashPlayer.reset(); // Ensure dash is off
|
||||
this.dashInitialized = false;
|
||||
}
|
||||
streamUrl = URL.createObjectURL(track.file);
|
||||
this.currentRgValues = null; // No replaygain for local files yet
|
||||
this.applyReplayGain();
|
||||
|
|
@ -319,8 +322,13 @@ export class Player {
|
|||
// Handle playback
|
||||
if (streamUrl && streamUrl.startsWith('blob:') && !track.isLocal) {
|
||||
// It's likely a DASH manifest blob URL
|
||||
this.dashPlayer.initialize(this.audio, streamUrl, true);
|
||||
this.dashInitialized = true;
|
||||
if (this.dashInitialized) {
|
||||
this.dashPlayer.attachSource(streamUrl);
|
||||
} else {
|
||||
this.dashPlayer.initialize(this.audio, streamUrl, true);
|
||||
this.dashInitialized = true;
|
||||
}
|
||||
|
||||
if (startTime > 0) {
|
||||
this.dashPlayer.seek(startTime);
|
||||
}
|
||||
|
|
|
|||
12
styles.css
12
styles.css
|
|
@ -1256,6 +1256,11 @@ body.has-page-background .track-item:hover {
|
|||
.btn-primary:hover {
|
||||
transform: scale(1.05);
|
||||
box-shadow: var(--shadow-md);
|
||||
filter: brightness(0.9);
|
||||
}
|
||||
|
||||
.btn-primary:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.btn-primary:disabled {
|
||||
|
|
@ -1281,6 +1286,11 @@ body.has-page-background .track-item:hover {
|
|||
|
||||
.btn-secondary:hover {
|
||||
background-color: var(--muted);
|
||||
filter: brightness(1.1);
|
||||
}
|
||||
|
||||
.btn-secondary:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.btn-secondary:disabled {
|
||||
|
|
@ -2596,7 +2606,7 @@ input:checked + .slider::before {
|
|||
|
||||
@supports (padding-top: env(safe-area-inset-top)) {
|
||||
.now-playing-bar {
|
||||
padding-bottom: max(var(--spacing-md), env(safe-area-inset-bottom));
|
||||
padding-bottom: max(var(--spacing-sm), env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
.main-content,
|
||||
|
|
|
|||
Loading…
Reference in a new issue