-
Notifications
You must be signed in to change notification settings - Fork 136
[Proposal]: Thumbnails: Add supplementary metadata to getAvailableThumbnailTracks
#1605
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
Open
peaBerberian
wants to merge
2
commits into
dev
Choose a base branch
from
feat/thumbnail-tracks-more-metadata
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
getAvailableThumbnailTracksgetAvailableThumbnailTracks
95c5d6d to
1df2e07
Compare
8352bed to
2f9d45b
Compare
4b3ddb5 to
3fb82ce
Compare
2f9d45b to
61c392c
Compare
61c392c to
0398cce
Compare
3fb82ce to
e03209c
Compare
0398cce to
3e1f900
Compare
e03209c to
2bdfa56
Compare
3e1f900 to
af0c737
Compare
424b13c to
5da7adc
Compare
5f64eba to
527b686
Compare
af0c737 to
c296ec4
Compare
01ae4db to
3eb62bd
Compare
8908dfa to
4f7fca7
Compare
Florent-Bouisset
approved these changes
Jun 18, 2025
4f7fca7 to
3733d8e
Compare
Collaborator
Author
41fc4ac to
d535a6b
Compare
d535a6b to
8a84ba5
Compare
8a84ba5 to
7dbbbd2
Compare
6d4fed2 to
9b856a5
Compare
7dbbbd2 to
72d4cb0
Compare
|
✅ Automated performance checks have passed on commit DetailsPerformance tests 1st run outputNo significative change in performance for tests:
|
Based on #1496 Problem ------- We're currently trying to provide a complete[1] and easy to-use API for DASH thumbnail tracks in the RxPlayer. Today the proposal is to have an API called `renderThumbnail`, to which an application would just provide an HTML element and a timestamp, and the RxPlayer would do all that's necessary to fetch the corresponding thumbnail and display it in the corresponding element. The API is like so: ```js rxPlayer.renderThumbnail({ element, time }) .then(() => console.log("The thumbnail is now rendered in the element")); ``` This works and seems to me very simple to understand. Yet, we've known of advanced use cases where an application might not just want to display a single thumbnail for a single position. For example, there's very known examples where an application displays a window of multiple thumbnails at once on the player's UI to facilitate navigation inside the content. To do that under the solution proposed in #1496, an application could just call `renderThumbnail` with several `element` and `time` values. Yet for this type of feature, what the interface would want is not really to indicate a `time` values, it actually wants basically a list of distinct thumbnails around/before/after a given position. By just being able to set a `time` value, an application is blind on which `time` value is going to lead to a different timestamp (i.e. is the thumbnail for the `time` `11` different than the thumbnail for the `time` `12`? Nobody - but the RxPlayer - knows). So we have to find a solution for this [1] By complete, I here mean that we want to be able to handle its complexities inside the RxPlayer, to ensure complex DASH situations like multi-CDN, retry settings for requests and so on while still allowing all potential use cases for an application. Solution -------- In this solution, I experiment with a second thumbnail API, `getAvailableThumbnailTracks` (it already exists in #1496, but its role there was only to list the various thumbnail qualities, if there are several size for example). As this solution build upon yet stays compatible to #1496, I chose to open this second PR on top of that previous one. I profit from the fact that most standardized thumbnail implementations I know of (BIF, DASH) seem follow the principle of having evenly-spaced (in terms of time) thumbnails (though I do see a possibility for that to change, e.g. to have thumbnails corresponding to "important" scenes instead, so our implementation has to be resilient). So here, what this commit does is to add the following properties (all optional) to a track returned by the `getAvailableThumbnailTracks` API: - `start`: The initial `time` the first thumbnail of that track will apply to - `end`: The last `time` the last thumbnail of that track will apply to - thumbnailsPerSegment: Individual thumbnails may be technically part of "segments" containing multiple consecutive thumbnails each. `thumbnailsPerSegment` is the number of thumbnails each of those segments contain. For example you could have stored on the server a segment which is a grid of 2 x 3 (2 horizontal rows and * 3 vertical columns) thumbnails, which the RxPlayer will load at once then "cut" the right way when calling `renderThumbnail`. In that example, `thumbnailsPerSegment` would be set to `6` (2*3). Note that the last segment of a content may contain less thumbnails as anounced here depending on the duration of the content. - `segmentDuration`: The "duration" (in seconds) each segments of thumbnails applies to (with the exception of the last thumbnail, which just fills until `end`) Then, an application should have all information needed to calculate a `time` which correspond to a different thumbnail. Though this solution lead to a minor issue: by letting application make the `time` operation themselves with `start`, `end`, `segmentDuration` and so on, there's a risk of rounding errors leading to a `time` which does not correspond to the thumbnail wanted but the one before or after. To me, we could just indicate in our API documentation to application developers that they should be extra careful and may add an epsilon (or even choose a `time` in the "middle" of thumbnails each time) if they want that type of thumbnail list feature. Thoughts?
72d4cb0 to
459d27c
Compare
|
✅ Automated performance checks have passed on commit DetailsPerformance tests 1st run outputNo significative change in performance for tests:
|
6cfd206 to
1e55170
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Priority: 3 (Low)
This issue or PR has a low priority.
proposal
This Pull Request or Issue is only a proposal for a change with the expectation of a debate on it
thumbnails
Relative to image thumbnails
work-in-progress
This Pull Request or issue is not finished yet
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.

EDIT: I added
lastThumbnailTimewhich is an estimate of the start time of the last available thumbnail for a track. This is to help cases where the application wants to load multiple thumbnails until the last one.Problem
We're currently trying to provide a complete[1] and easy to-use API for DASH thumbnail tracks in the RxPlayer.
Today the proposal is to have an API called
renderThumbnail, to which an application would just provide an HTML element and a timestamp, and the RxPlayer would do all that's necessary to fetch the corresponding thumbnail and display it in the corresponding element.The API is like so:
This works and seems to me very simple to understand.
Yet, we've known of advanced use cases where an application might not just want to display a single thumbnail for a single position. For example, there's very known examples where an application displays a window of multiple thumbnails at once on the player's UI to facilitate navigation inside the content.
Screenshot: this is the interface of a very popular web media player (the official one from the platform for which you installed newpipe instead) where multiple thumbnails are shown at once, under the seek bar. Interestingly, the video is also replaced by a thumbnail in that mode here, I guess to provide a smoother experience when rapidly navigating in the content.
To do that under the solution proposed in #1496, an application could just call
renderThumbnailwith severalelementandtimevalues.Yet for this type of feature, what the interface would want is not really to indicate
timevalues, it actually wants basically a list of distinct thumbnails around/before/after a given position.By just being able to set a
timevalue, an application is blind on whichtimevalue is going to lead to a different thumbnail (i.e. is the thumbnail for thetime11different than the thumbnail for thetime12? Nobody - but the RxPlayer - knows).So we have to find a solution for this
[1] By complete, I here mean that we want to be able to handle its complexities inside the RxPlayer to ensure advanced DASH configurations like multi-CDN, retry settings for requests etc., while still allowing all potential use cases for an application.
Solution
In this solution, I experiment with a second thumbnail API,
getAvailableThumbnailTracks(it already exists in #1496, but its role there was only to list the various thumbnail qualities, if there are several size for example). As this solution build upon yet stays compatible to #1496, I chose to open this second PR on top of that previous one.I profit from the fact that most standardized thumbnail implementations I know of (BIF, DASH) seem to follow the principle of having evenly-spaced (in terms of time) thumbnails (though I do see a possibility for that to change, e.g. to have thumbnails corresponding to "important" scenes instead, so our implementation has to be resilient).
So here, what this PR does is to add the following properties (all optional) to a track returned by the
getAvailableThumbnailTracksAPI:start: The initialtimethe first thumbnail of that track will apply toend: The lasttimethe last thumbnail of that track will apply to.endwill announce the future expected end of the Period if already known (for example thanks to aPeriod@endor aSegmentTemplate@endNumberattribute) - andundefinedif unknown.In this current configuration, an application has to also request another API, like
getLivePositionto know the maximum position it can currently load thumbnails fromthumbnailsPerSegment: Individual thumbnails may be technically part of "segments" containing multiple consecutive thumbnails each.thumbnailsPerSegmentis the number of thumbnails each of those segments contain.For example you could have stored on the server a segment which is a grid of 2 x 3 (2 horizontal rows and * 3 vertical columns) thumbnails, which the RxPlayer will load at once then "cut" the right way when calling
renderThumbnail. In that example,thumbnailsPerSegmentwould be set to6(2*3).Note that the last segment of a content may contain less thumbnails as announced here depending on the duration of the content.
thumbnailDuration: The "duration" (in seconds) each thumbnail applies tolastThumbnailTime: The last starting time for the last thumbnail currently available in that track. For live contents this value may become outdated quickly, but it gives an indication on the last thumbnail currently served.Then, an application should have all information needed to calculate a
timewhich correspond to a different thumbnail.Though this solution lead to a minor issue: by letting application make the
timeoperation themselves withstart,end,thumbnailDurationand so on, there's a risk of rounding errors leading to atimewhich does not correspond to the thumbnail wanted but the one before or after. To me, we could just indicate in our API documentation to application developers that they should be extra careful and may add an epsilon (or even choose atimein the "middle" of thumbnails each time) if they want that type of thumbnail list feature.Thoughts?