gitbobobo / StreamMusic

支持 Android、iOS、macOS、Windows 平台的 Subsonic/Navidrome/Jellyfin/Emby/AudioStation 客户端。
https://music.aqzscn.cn/
762 stars 24 forks source link

[Bug] iOS 端音流无法后台切歌 #240

Closed kierankihn closed 5 months ago

kierankihn commented 5 months ago

Describe the bug (BUG 描述) 在 iOS 版音流中,音流在后台播放的情况下,无法切换到下一首歌曲

To Reproduce (复现步骤) Steps to reproduce the behavior:

  1. 打开音流,随便找一个专辑开始播放
  2. 第一首歌正常播放,此时切换到后台
  3. 等待第一首歌播放完毕之后,音流无法在后台切换到下一首歌
  4. 切换回音流,此时任何歌曲都无法播放,点击播放之后进度条显示为 00:00

Expected behavior (期望行为) 可以正常后台切歌

Screenshots (截图) If applicable, add screenshots to help explain your problem.

Platform and Device Info (操作系统及设备信息)

Music Server Type (音乐服务器类型) Emby 4.8.3.0

Additional context (额外信息) 在 Windows 版音流上可以正常播放

kierankihn commented 5 months ago

相关日志:

ERROR 18:50:40.366 (+0:05:57.920397)
  ERROR ⛔ 下载歌曲失败:DioException [bad response]: This exception was thrown because the response has a status code of 401 and RequestOptions.validateStatus was configured to throw for this status code.
  ERROR ⛔ The status code of 401 has the following meaning: "Client error - the request contains bad syntax or cannot be fulfilled"
  ERROR ⛔ Read more about status codes at https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
  ERROR ⛔ In order to resolve this exception you typically have either to verify and fix your request code or you have to fix the server code
kierankihn commented 5 months ago

服务端的日志:

2024-04-20 18:45:19.387 Warn Server: AUTH-ERROR: *.*.*.* - Access token is invalid or expired.
2024-04-20 18:45:19.387 Error Server: Access token is invalid or expired.
2024-04-20 18:45:19.387 Info Server: http/1.0 Response 401 to host13. Time: 2ms. GET http://emby_remote_ip/Audio/42986/stream?static=true
2024-04-20 18:46:06.654 Info Server: http/1.0 POST http://emby_remote_ip/Users/6e2e9c1434b9429ea689418e51de3d78/PlayedItems/41566?datePlayed=20240420104451. UserAgent: Dart/3.3 (dart:io)
2024-04-20 18:46:06.662 Info HttpClient: POST http://ws.audioscrobbler.com/2.0/?format=json
2024-04-20 18:46:06.666 Info Server: http/1.0 Response 200 to host13. Time: 12ms. POST http://emby_remote_ip/Users/6e2e9c1434b9429ea689418e51de3d78/PlayedItems/41566?datePlayed=20240420104451
2024-04-20 18:46:07.054 Info Last.fm: example played 'the dots' - HATSUNE MIKU Digital Stars 2023 Compilation - Various Artists
2024-04-20 18:49:16.128 Info Server: http/1.0 HEAD http://emby_remote_ip/. UserAgent: Mozilla/5.0+(compatible; UptimeRobot/2.0; http://www.uptimerobot.com/)
2024-04-20 18:49:16.128 Info Server: http/1.0 Response 302 to host2. Time: 1ms. HEAD http://emby_remote_ip/
2024-04-20 18:49:35.686 Info Server: http/1.0 GET http://emby_remote_ip/Audio/42986/stream?static=true. Accept=*/*, Connection=close, Host=emby_remote_ip, User-Agent=libmpv, Accept-Encoding=gzip, Authorization=MediaBrowser Client="Stream Music", Device="iPhone", DeviceId="example", Version="1.2.7", Token="example", Range=bytes=0-, Via=1.1 shelf_proxy, Content-Length=0, X-Real-IP=host13, X-Forwarded-For=host13, X-Forwarded-Proto=https, X-Forwarded-Protocol=https, X-Forwarded-Host=emby_remote_ip, x-streammusic-savepath=/var/mobile/Containers/Data/Application/2A59DDE2-5610-4FA5-80DD-FB32AB182183/Library/Caches/sm_caches/songs/42986.flac, icy-metadata=1, x-streammusic-audioid=42986
2024-04-20 18:50:30.567 Info Server: http/1.0 Response 206 to host13. Time: 54882ms. GET http://emby_remote_ip/Audio/42986/stream?static=true
2024-04-20 18:50:40.430 Info Server: http/1.0 GET http://emby_remote_ip/Audio/43609/stream?static=true. Connection=close, Host=emby_remote_ip, User-Agent=Dart/3.3 (dart:io), Accept-Encoding=gzip, X-Real-IP=host13, X-Forwarded-For=host13, X-Forwarded-Proto=https, X-Forwarded-Protocol=https, X-Forwarded-Host=emby_remote_ip
2024-04-20 18:50:40.431 Warn Server: AUTH-ERROR: *.*.*.* - Access token is invalid or expired.
2024-04-20 18:50:40.431 Error Server: Access token is invalid or expired.
2024-04-20 18:50:40.431 Info Server: http/1.0 Response 401 to host13. Time: 2ms. GET http://emby_remote_ip/Audio/43609/stream?static=true
2024-04-20 18:51:31.058 Info Server: http/1.0 POST http://emby_remote_ip/Users/6e2e9c1434b9429ea689418e51de3d78/PlayedItems/42986?datePlayed=20240420104934. UserAgent: Dart/3.3 (dart:io)
2024-04-20 18:51:31.064 Info HttpClient: POST http://ws.audioscrobbler.com/2.0/?format=json
2024-04-20 18:51:31.066 Info Server: http/1.0 Response 200 to host13. Time: 9ms. POST http://emby_remote_ip/Users/6e2e9c1434b9429ea689418e51de3d78/PlayedItems/42986?datePlayed=20240420104934
2024-04-20 18:51:31.362 Info Last.fm: example played '異形の精霊' - きくおミク3 - きくお

现在我感觉是服务端的问题了?

日志中说 auth error,但是此时我在音流中没有没登出,也能手动更新歌曲信息

但是唯独无法连续播放歌曲

kierankihn commented 5 months ago

抱歉,应该确实是服务端的问题