Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client-Side checking of compatible audio format/codec/container (WebUI) #2051

Open
metalheim opened this issue Dec 19, 2022 · 3 comments
Open

Comments

@metalheim
Copy link
Contributor

metalheim commented Dec 19, 2022

The current issue

Web Browsers don't support all the audio codecs/container combinations. Currently, if an incompatible file is attemped to be played and no transcoding profile has been selected before, the playback won't start and there is no error message.

This feels broken to the user and leads to bug issues like #1910 and #1441
We should at least give the user a hint what happened.

A clear and concise description of what you would like to happen.

The WebUI should check clientside if the currently selected song can be played in this browser.

  1. if file is not compatible, at least give an error mesage (incompatible file type) that visible to the user
  2. ideally, it would trigger a request for a transcoded version of the file.

Additional context

The compatability check could be done with the Browser audio.canPlayType method. https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canPlayType

The audio.canPlayType method needs mimetype of the file. This can be ambigous (f.e. files encoded in ALAC codec have mimetype "audio/mp4", which isnt very helpful as "audio/mp4" can be a multitude of things...)
So the canplayType may needs to be augmented by "compatability/transcoding profiles", similar to how f.e. jellyfin handles it. I'll cross-post in #351

Steps

[x] Capture mimetype (lookup from file extension)
[ ] Capture music codec/container/format properly (e.g. with scanner extractor - as mimetype isnt precise enough**)
[] expose codec /bitrate /MIME type via api to frontend (add to "/api/song")
[] check if audio is playable
[] if not, at least give an error mesage (incompatible file type) that visible to the user

[] to be done later: Trigger a request for a transcoded file in a know-working format.

@deluan
Copy link
Member

deluan commented Dec 21, 2022

That's a good idea! Will try to come up with something like this when working on the new transcoding. Thanks for the suggestion.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Navidrome team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@tty228
Copy link

tty228 commented Nov 16, 2023

Reporting a similar issue, when using Navidrome to play music, I sometimes encounter a problem where songs do not automatically move to the next track and instead pause in the last few seconds.
There is no useful information in the logs (the current log debug level is set to info).
The song files are in FLAC format, and I finally found the reason: these FLAC files have integrity issues, but Navidrome does not skip them when an error occurs.

Version:0.49.3 (8b93962)

589cdcd5bc909 deluan/navidrome:latest navidrome 146.23MB 2023/02/14 09:31:17

How Navidrome is installed?
Docker

Configuration
No response

Relevant log output
No response

Anything else?
No response

Code of Conduct
√ I agree to follow Navidrome's Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants