rasmuslos / AmpFin

Native Jellyfin music player for iOS & iPadOS
Other
107 stars 10 forks source link

OPUS and Vorbis files cannot be played. #25

Closed freedompath closed 3 months ago

freedompath commented 3 months ago

When trying to play Opus or Vorbis files, the program skips to the next Mp3 file and only plays this file. However, the Vorbis or Opus titles and covers are displayed when the Mp3 file is played.

rasmuslos commented 3 months ago

You can now play any audio format supported by Jellyfin. The problem is that the duration is not correct.

This is caused by AVPlayer not accepting hls playlists when they come from the Jellyfin endpoint. All audio files have to be transcoded using the http protocol. I wanted to swap out AVPlayer for AudioStreaming, it would also provide additional features like gapless playback and an equalizer, but it does not support dequeuing (https://github.com/dimitris-c/AudioStreaming/issues/73) so we will have to wait until it is implemented before I can replace AVPlayer.

freedompath commented 3 months ago

Ah I understand! Thank you very much for your quick response!

gnattu commented 3 months ago

This is caused by AVPlayer not accepting hls playlists when they come from the Jellyfin endpoint. All audio files have to be transcoded using the http protocol.

Actually it is not. This is due to a bug in the 10.8 Jellyfin branch. The webclient's container request is in a wrong format and the server is having some problem dealing with the request. The server also has some internal logic errors that will cause it to return wrong response even if the request is valid. As you are using the request format from the webclient, then it will not work properly.

I added some comments to the commit: https://github.com/rasmuslos/AmpFin/commit/b041cc457e891624198dd9c614c0954fcfe63545

After fixing those you will be able to get transcoded stream working with a 10.9 server. There is no need to replace the AVPlayer because it is more of a server-side bug.

rasmuslos commented 3 months ago

I added some comments on the commit 👍

rasmuslos commented 3 months ago

Also i forgot to update the download logic, but this has been resolved. If you download the tracks that have to be transcoded they will now be saved as an aac file. For local files the duration is correct.