-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
feat: allow customization of tvOS playback expierence #3216
feat: allow customization of tvOS playback expierence #3216
Conversation
playerItem.externalMetadata = createMetadataItems(for: mapping) | ||
} | ||
|
||
#if os(tvOS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this #if can be earlier in this function to avoid unnecessary computation on mobile ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The external metadata can also be set on iOS to replace the asset metadata, therefore I only restricted the navigationMarker Groups to tvOS as this is only working on tvOS.
https://developer.apple.com/documentation/avfoundation/avplayeritem/1627623-externalmetadata
ios/Video/RCTVideo.swift
Outdated
} | ||
|
||
#if os(tvOS) | ||
private func makeNavigationMarkerGroups(_ chapters: [Chapter]) -> [AVNavigationMarkersGroup] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to extract these new functions in a new file...
This one is already too big.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I outsourced the functions to a new file
@Duell10111 I forgot to publish my review :'( |
@freeboub Thanks for the review, I outsourced the functions to Util files to reduce the code in the RCTVideo class. So from my POV the PR can be merged. :) |
This PR would allow to customize the tvOS playback expierence as descripted here:
https://developer.apple.com/documentation/avkit/customizing_the_tvos_playback_experience#3820220
The custom title, subtitle and description are all optional and can specified in the source object.
These props are not handled on android side.
Additionally this PR allows to adapt the chapters interface for tvOS, according to the documentation:
https://developer.apple.com/documentation/avkit/presenting_navigation_markers#2948687
For providing custom chapters, a new prop chapters got introduced.
Provide an example of how to test the change
The changes can be tested in the tvOS example project, by running on an tvOS simulator.