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

Report playback stopped when media finishes #668

Merged
merged 2 commits into from
Nov 4, 2024

Conversation

3flex
Copy link
Contributor

@3flex 3flex commented Nov 4, 2024

This consolidates the logic for reporting stopped playback to the server so it is only reported when MEDIA_FINISHED event is fired. In addition, the current position reported to the server will be the current time reported by the Cast player which will be the most accurate representation. If this is not available, it will fall back to the existing logic of checking the current playback position from the receiver's playback state.

This PR also fixes an issue that occurs when changing audio or subtitle streams. The Cast view would show the "waiting" view after a request to change subtitle or audio streams. Now, the player remains visible when changing streams.

This consolidates the logic for reporting stopped playback to the server.
The MEDIA_FINISHED event is fired when:
* End of stream is reached
* Error encountered
* Playback has been stopped
* Playback was interrupted because a new item was loaded

https://developers.google.com/cast/docs/reference/web_receiver/cast.framework.events#.EndedReason

The current position reported to the server will be the current time
reported by the Cast player which will be the most accurate representation.
If this is not available, it will fall back to the existing logic of
checking the current playback position from the receiver's playback state.
@3flex 3flex marked this pull request as draft November 4, 2024 01:07
@3flex 3flex marked this pull request as ready for review November 4, 2024 02:35
@nielsvanvelzen nielsvanvelzen merged commit 5c51cdf into jellyfin:master Nov 4, 2024
5 checks passed
@3flex 3flex deleted the stop-on-media-finished branch November 5, 2024 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants