Repository navigation
Report when a video plays to its end - #51
Merged
Merged
Conversation
GaplessEvent.Completed fires when the clip on screen reaches its last frame, or a stream finishes, while that frame stays up until the next play(). Ended still follows when something replaces it. A host can now cut to the next asset as soon as a clip or stream is done instead of holding its last frame until its own timer fires, which matters for streams of unknown length and clips shorter than their slot. Only the clip on screen counts, once per play; a staged clip and a report about a clip already replaced or stopped are ignored. A live stream that just stops arriving still stalls and ends in PlaybackError. Adding a GaplessEvent subclass breaks exhaustive when expressions over it, so hosts need a new branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
GaplessEvent.Completed(asset, playbackId), emitted when the video on screen reaches its end: a clip's last frame, or a stream that finished (video on demand, or a live stream the server marked as ended). The last frame stays on screen until the nextplay(), andEndedstill follows when something replaces it.Until now a host had no way to know a clip or stream was done, so the screen held its last frame until the host's own timer fired. With
Completedit can cut to the next asset at once, which matters for streams of unknown length and clips shorter than their slot. On the TV, the sample clips complete 80 to 150 ms before their slot ends, which was a held last frame until now.Completedonly for its current asset; a report about one already replaced or stopped is dropped.PlaybackError, as before.Adding a
GaplessEventsubclass breaks exhaustivewhenexpressions over it, so hosts need a new branch, as the sample app did.Tests: the engine reports the end of the playing clip once, ignores a staged clip, and reports again for the next clip; the controller reports the current video and ignores one already replaced or stopped. Checked on the TV with the
codecsplaylist:Completedarrives before eachEnded.