jellyfin / jellyfin-web

Web Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
2.27k stars 1.2k forks source link

Browser autoplay permissions leave web client stuck at splash screen #4901

Open Terrance opened 10 months ago

Terrance commented 10 months ago

Describe The Bug

When first selecting media (from Android) to play on a remote web client, the splash screen with the series artwork appears, but playback never begins. Turns out this is because the browser is blocking autoplay, but there's no indication in the client that this is happening.

In Firefox, right-clicking the web client screen and selecting Play gets things moving (native browser controls are hidden, and Jellyfin's controls are also hidden / behind the splash screen), at which point Play/Pause then works as expected from Android too. After unsticking it in this way, subsequent launches (of the same or different content) also continue work in the current session (i.e. it only affects web client sessions that haven't had media launched yet).

Steps To Reproduce

  1. Open Jellyfin Web on one device (calling it remote from now on)
  2. Open Jellyfin Android on another device (local)
  3. local: Play Onremote
  4. local: Browse to a media item
  5. local: Play
    • remote: Splash screen appears
    • remote: Playback does not start
  6. remote: Manually start playback (e.g. from right-click menu)
    • remote: Playback starts as expected
  7. local: Browse to a different media item
  8. local: Play
    • remote: Playback starts as expected

Expected Behavior

Playback to start normally on the first launch, or some kind of prompt to either manually start playback or adjust autoplay settings in the browser.

Logs

When first triggering remote playback:

12:47:46.638    Requesting https://example.com/Users/919c3da49b204bbe8145dc75ea7a8b18/Items/60cc8807f3b04a8183df8b28bb8be5d5    main.jellyfin.bundle.js:2:790340
12:47:46.664    Requesting https://example.com/Users/919c3da49b204bbe8145dc75ea7a8b18/Items/60cc8807f3b04a8183df8b28bb8be5d5/Intros main.jellyfin.bundle.js:2:790340
12:47:46.698    Requesting url without automatic networking: https://example.com/Items/60cc8807f3b04a8183df8b28bb8be5d5/PlaybackInfo?UserId=919c3da49b204bbe8145dc75ea7a8b18&StartTimeTicks=0&IsPlayback=true&AutoOpenLiveStream=true&AudioStreamIndex=1&SubtitleStreamIndex=2&MediaSourceId=60cc8807f3b04a8183df8b28bb8be5d5&MaxStreamingBitrate=140000000 main.jellyfin.bundle.js:2:791417
12:47:47.031    playing url: https://example.com/videos/60cc8807-f3b0-4a81-83df-8b28bb8be5d5/master.m3u8?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NDsgcnY6ODcuMCkgR2Vja28vMjAxMDAxMDEgRmlyZWZveC84Ny4wfDE2MTYxNTgwNzYwOTA1&MediaSourceId=60cc8807f3b04a8183df8b28bb8be5d5&VideoCodec=h264,h264&AudioCodec=aac&AudioStreamIndex=1&VideoBitrate=139808000&AudioBitrate=192000&AudioSampleRate=44100&MaxFramerate=23.976025&PlaySessionId=edf9923d76bb494189546450eed92c4d&api_key=0b70e32d33c8474daa2dbffb6748e800&TranscodingMaxAudioChannels=2&RequireAvc=false&Tag=9fee75b5b5a88c72408158d9e56cc073&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-level=40&h264-videobitdepth=8&h264-profile=high&h264-audiochannels=2&aac-profile=lc&h264-rangetype=SDR&h264-deinterlace=true&TranscodeReasons=VideoCodecNotSupported,%20AudioCodecNotSupported htmlVideoPlayer-plugin.b0f4f3c2e8ed40a9f707.chunk.js:1:9384
12:47:47.174    Active player: {"name":"Html Video Player","id":"htmlvideoplayer","playerName":"Html Video Player","playableMediaTypes":[false,true,false,false],"isLocalPlayer":true,"supportedCommands":["GoHome","GoToSettings","VolumeUp","VolumeDown","Mute","Unmute","ToggleMute","SetVolume","SetAudioStreamIndex","SetSubtitleStreamIndex","SetMaxStreamingBitrate","DisplayContent","GoToSearch","DisplayMessage","SetRepeatMode","SetShuffleQueue","PlayMediaSource","PlayTrailers","ToggleFullscreen","SetBrightness","SetAspectRatio","PlaybackRate"]}  main.jellyfin.bundle.js:2:141901
12:47:47.174    SyncPlay WrapperFactory getWrapper: htmlvideoplayer main.jellyfin.bundle.js:2:252011
12:47:47.175    Requesting url without automatic networking: https://example.com/Sessions/Playing   main.jellyfin.bundle.js:2:791417
12:47:47.176    nowplaying event: playbackstart 9944.7c989716de118dc7f50a.chunk.js:1:7787
12:47:47.176    nowplaying event: playbackstart 9944.7c989716de118dc7f50a.chunk.js:1:8473

After hitting Play again from the remote control:

12:47:52.223    Uncaught (in promise) DOMException: The play method is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. 

System

Server:

Web client:

Additional Context

This is a long-standing issue, first noticed back in 2021: https://github.com/jellyfin/jellyfin/issues/5669#issuecomment-889683578

jellyfin-bot commented 6 months ago

This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments.

If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or master branch, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label.

This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.

Terrance commented 6 months ago

Still an issue on 10.8.13.

jellyfin-bot commented 2 months ago

This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments.

If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or master branch, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label.

This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.

Terrance commented 2 months ago

Still an issue on 10.9.6.