feat(ReelItem): Add accessibility label #401
Merged
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.
ReelItems unfortunately only have their duration in one place, the accessibility label in textual form. As parsing that information out is language dependent, it should be left up to library users to do.
An example for how to parse that can be found here: https://github.com/FreeTubeApp/FreeTube/blob/bd6fb416a8b6ba388321dcc20c3d7d89c744f0f1/src/renderer/helpers/api/local.js#L300
Some examples for the accessibility label in English taken from the shorts tab on the LTT channel:
These mice keep getting WEIRDER... - 59 seconds - play video
How Low Can Our Resolution Go? - 1 minute - play video
I just found out about Elon. #SHORTS - 1 minute, 1 second - play video
(I suspect this is a rounding error on YouTube's side, as the docs say shorts can only be up to 60 seconds long, https://support.google.com/youtube/answer/10059070?hl=en)