docs: add visionOS platform (#3477)

* docs: add visionOS platform

* update docs
This commit is contained in:
Krzysztof Moch 2024-01-16 07:21:38 +01:00 committed by GitHub
parent cf3ebb7f15
commit 53359a248b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 74 additions and 55 deletions

View File

@ -1,5 +1,7 @@
# DRM # DRM
> **Note:** DRM is not supported on visionOS yet.
## Provide DRM data (only tested with http/https assets) ## Provide DRM data (only tested with http/https assets)
You can provide some configuration to allow DRM playback. You can provide some configuration to allow DRM playback.

View File

@ -10,26 +10,26 @@ This page shows the list of available callbacks to handle player notifications
| [onBandwidthUpdate](#onbandwidthupdate) | Android | | [onBandwidthUpdate](#onbandwidthupdate) | Android |
| [onBuffer](#onbuffer) | Android, iOS | | [onBuffer](#onbuffer) | Android, iOS |
| [onEnd](#onend) | All | | [onEnd](#onend) | All |
| [onError](#onerror) | Android, iOS, Windows UWP | | [onError](#onerror) | All |
| [onExternalPlaybackChange](#onexternalplaybackchange) | iOS | | [onExternalPlaybackChange](#onexternalplaybackchange) | iOS |
| [onFullscreenPlayerWillPresent](#onfullscreenplayerwillpresent) | Android, iOS | | [onFullscreenPlayerWillPresent](#onfullscreenplayerwillpresent) | Android, iOS, visionOS |
| [onFullscreenPlayerDidPresent](#onfullscreenplayerdidpresent) | Android, iOS | | [onFullscreenPlayerDidPresent](#onfullscreenplayerdidpresent) | Android, iOS, visionOS |
| [onFullscreenPlayerWillDismiss](#onfullscreenplayerwilldismiss) | Android, iOS | | [onFullscreenPlayerWillDismiss](#onfullscreenplayerwilldismiss) | Android, iOS, visionOS |
| [onFullscreenPlayerDidDismiss](#onfullscreenplayerdiddismiss) | Android, iOS | | [onFullscreenPlayerDidDismiss](#onfullscreenplayerdiddismiss) | Android, iOS, visionOS |
| [onLoad](#onload) | All | | [onLoad](#onload) | All |
| [onLoadStart](#onloadstart) | All | | [onLoadStart](#onloadstart) | All |
| [onPictureInPictureStatusChanged](#onpictureinpicturestatuschanged) | iOS | | [onPictureInPictureStatusChanged](#onpictureinpicturestatuschanged) | iOS |
| [onPlaybackRateChange](#onplaybackratechange) | All | | [onPlaybackRateChange](#onplaybackratechange) | All |
| [onPlaybackStateChanged](#onplaybackstatechanged) | Android, iOS | | [onPlaybackStateChanged](#onplaybackstatechanged) | Android, iOS, visionOS |
| [onProgress](#onprogress) | All | | [onProgress](#onprogress) | All |
| [onReadyForDisplay](#onreadyfordisplay) | Android, iOS, Web | | [onReadyForDisplay](#onreadyfordisplay) | Android, iOS |
| [onReceiveAdEvent](#onreceiveadevent) | Android, iOS | | [onReceiveAdEvent](#onreceiveadevent) | Android, iOS |
| [onRestoreUserInterfaceForPictureInPictureStop](#onrestoreuserinterfaceforpictureinpicturestop) | iOS | | [onRestoreUserInterfaceForPictureInPictureStop](#onrestoreuserinterfaceforpictureinpicturestop) | iOS, visionOS |
| [onSeek](#onseek) | Android, iOS, Windows UWP | | [onSeek](#onseek) | All |
| [onTimedMetadata](#ontimedmetadata) | Android, iOS | | [onTimedMetadata](#ontimedmetadata) | Android, iOS, visionOS |
| [onTextTracks](#ontexttracks) | Android | | [onTextTracks](#ontexttracks) | Android |
| [onVideoTracks](#onvideotracks) | Android | | [onVideoTracks](#onvideotracks) | Android |
| [onVolumeChange](#onvolumechange) | Android, iOS | | [onVolumeChange](#onvolumechange) | Android, iOS, visionOS |
## Details ## Details

View File

@ -4,7 +4,7 @@ This page shows the list of available methods
## Component methods ## Component methods
| Name |Platforms Support | | Name |Platforms Support |
|-------------------------------------------------------------------------------------------|-------------------| |-------------------------------------------------------------------------------------------|-----------------------|
|[dismissFullscreenPlayer](#dismissfullscreenplayer) |Android, iOS | |[dismissFullscreenPlayer](#dismissfullscreenplayer) |Android, iOS |
|[presentFullscreenPlayer](#presentfullscreenplayer) |Android, iOS | |[presentFullscreenPlayer](#presentfullscreenplayer) |Android, iOS |
|[pause](#pause) |Android, iOS | |[pause](#pause) |Android, iOS |

View File

@ -8,49 +8,49 @@ This page shows the list of available properties to configure player
| [adTagUrl](#adtagurl) | Android, iOS | | [adTagUrl](#adtagurl) | Android, iOS |
| [allowsExternalPlayback](#allowsexternalplayback) | iOS | | [allowsExternalPlayback](#allowsexternalplayback) | iOS |
| [audioOnly](#audioonly) | All | | [audioOnly](#audioonly) | All |
| [audioOutput](#audioOutput) | Android, iOS | | [audioOutput](#audioOutput) | Android, iOS, visionOS |
| [automaticallyWaitsToMinimizeStalling](#automaticallywaitstominimizestalling) | iOS | | [automaticallyWaitsToMinimizeStalling](#automaticallywaitstominimizestalling) | iOS, visionOS |
| [backBufferDurationMs](#backbufferdurationms) | Android | | [backBufferDurationMs](#backbufferdurationms) | Android |
| [bufferConfig](#bufferconfig) | Android | | [bufferConfig](#bufferconfig) | Android |
| [contentStartTime](#contentstarttime) | Android | | [contentStartTime](#contentstarttime) | Android |
| [controls](#controls) | Android, iOS | | [controls](#controls) | Android, iOS, visionOS |
| [currentPlaybackTime](#currentplaybacktime) | Android | | [currentPlaybackTime](#currentplaybacktime) | Android |
| [debug](#debug) | Android | | [debug](#debug) | Android |
| [disableFocus](#disablefocus) | Android, iOS | | [disableFocus](#disablefocus) | Android |
| [disableDisconnectError](#disabledisconnecterror) | Android | | [disableDisconnectError](#disabledisconnecterror) | Android |
| [filter](#filter) | iOS | | [filter](#filter) | iOS, visionOS |
| [filterEnabled](#filterenabled) | iOS | | [filterEnabled](#filterenabled) | iOS, visionOS |
| [focusable](#focusable) | Android | | [focusable](#focusable) | Android |
| [fullscreen](#fullscreen) | Android, iOS | | [fullscreen](#fullscreen) | Android, iOS |
| [fullscreenAutorotate](#fullscreenautorotate) | iOS | | [fullscreenAutorotate](#fullscreenautorotate) | iOS, visionOS |
| [fullscreenOrientation](#fullscreenorientation) | iOS | | [fullscreenOrientation](#fullscreenorientation) | iOS, visionOS |
| [headers](#headers) | Android | | [headers](#headers) | Android |
| [hideShutterView](#hideshutterview) | Android | | [hideShutterView](#hideshutterview) | Android |
| [ignoreSilentSwitch](#ignoresilentswitch) | iOS | | [ignoreSilentSwitch](#ignoresilentswitch) | iOS, visionOS |
| [maxBitRate](#maxbitrate) | Android, iOS | | [maxBitRate](#maxbitrate) | Android, iOS, visionOS |
| [minLoadRetryCount](#minloadretrycount) | Android | | [minLoadRetryCount](#minloadretrycount) | Android |
| [mixWithOthers](#mixwithothers) | iOS | | [mixWithOthers](#mixwithothers) | iOS, visionOS |
| [muted](#muted) | All | | [muted](#muted) | All |
| [paused](#paused) | All | | [paused](#paused) | All |
| [pictureInPicture](#pictureinpicture) | iOS | | [pictureInPicture](#pictureinpicture) | iOS |
| [playInBackground](#playinbackground) | Android, iOS | | [playInBackground](#playinbackground) | Android, iOS, visionOS |
| [playWhenInactive](#playwheninactive) | iOS | | [playWhenInactive](#playwheninactive) | iOS, visionOS |
| [poster](#poster) | All | | [poster](#poster) | All |
| [posterResizeMode](#posterresizemode) | All | | [posterResizeMode](#posterresizemode) | All |
| [preferredForwardBufferDuration](#preferredforwardbufferduration) | iOS | | [preferredForwardBufferDuration](#preferredforwardbufferduration) | iOS, visionOS |
| [preventsDisplaySleepDuringVideoPlayback](#preventsdisplaysleepduringvideoplayback) | iOS, Android | | [preventsDisplaySleepDuringVideoPlayback](#preventsdisplaysleepduringvideoplayback) | iOS, Android |
| [progressUpdateInterval](#progressupdateinterval) | All | | [progressUpdateInterval](#progressupdateinterval) | All |
| [rate](#rate) | All | | [rate](#rate) | All |
| [repeat](#repeat) | All | | [repeat](#repeat) | All |
| [reportBandwidth](#reportbandwidth) | Android | | [reportBandwidth](#reportbandwidth) | Android |
| [resizeMode](#resizemode) | Android, iOS, Windows UWP | | [resizeMode](#resizemode) | All |
| [selectedAudioTrack](#selectedaudiotrack) | Android, iOS | | [selectedAudioTrack](#selectedaudiotrack) | Android, iOS, visionOS |
| [selectedTextTrack](#selectedtexttrack) | Android, iOS | | [selectedTextTrack](#selectedtexttrack) | Android, iOS visionOS |
| [selectedVideoTrack](#selectedvideotrack) | Android | | [selectedVideoTrack](#selectedvideotrack) | Android |
| [shutterColor](#shutterColor) | Android | | [shutterColor](#shutterColor) | Android |
| [source](#source) | All | | [source](#source) | All |
| [subtitleStyle](#subtitlestyle) | Android | | [subtitleStyle](#subtitlestyle) | Android |
| [textTracks](#texttracks) | Android, iOS | | [textTracks](#texttracks) | Android, iOS, visionOS |
| [trackId](#trackid) | Android | | [trackId](#trackid) | Android |
| [useTextureView](#usetextureview) | Android | | [useTextureView](#usetextureview) | Android |
| [useSecureView](#usesecureview) | Android | | [useSecureView](#usesecureview) | Android |
@ -92,14 +92,14 @@ Changes the audio output.
* **speaker (default)** - plays through speaker * **speaker (default)** - plays through speaker
* **earpiece** - plays through earpiece * **earpiece** - plays through earpiece
Platforms: Android, iOS Platforms: Android, iOS, visionOS
### `automaticallyWaitsToMinimizeStalling` ### `automaticallyWaitsToMinimizeStalling`
A Boolean value that indicates whether the player should automatically delay playback in order to minimize stalling. For clients linked against iOS 10.0 and later A Boolean value that indicates whether the player should automatically delay playback in order to minimize stalling. For clients linked against iOS 10.0 and later
* **false** - Immediately starts playback * **false** - Immediately starts playback
* **true (default)** - Delays playback in order to minimize stalling * **true (default)** - Delays playback in order to minimize stalling
Platforms: iOS Platforms: iOS, visionOS
### `backBufferDurationMs` ### `backBufferDurationMs`
The number of milliseconds of buffer to keep before the current position. This allows rewinding without rebuffering within that duration. The number of milliseconds of buffer to keep before the current position. This allows rewinding without rebuffering within that duration.
@ -160,7 +160,7 @@ Note on iOS, controls are always shown when in fullscreen mode.
Note on Android, native controls are available by default. Note on Android, native controls are available by default.
If needed, you can also add your controls or use a package like [react-native-video-controls](https://github.com/itsnubix/react-native-video-controls) or [react-native-media-console](https://github.com/criszz77/react-native-media-console), see [Useful Side Project](/projects). If needed, you can also add your controls or use a package like [react-native-video-controls](https://github.com/itsnubix/react-native-video-controls) or [react-native-media-console](https://github.com/criszz77/react-native-media-console), see [Useful Side Project](/projects).
Platforms: Android, iOS Platforms: Android, iOS, visionOS
### `contentStartTime` ### `contentStartTime`
The start time in ms for SSAI content. This determines at what time to load the video info like resolutions. Use this only when you have SSAI stream where ads resolution is not the same as content resolution. The start time in ms for SSAI content. This determines at what time to load the video info like resolutions. Use this only when you have SSAI stream where ads resolution is not the same as content resolution.
@ -210,6 +210,7 @@ Platforms: Android
To setup DRM please follow [this guide](/component/drm) To setup DRM please follow [this guide](/component/drm)
Platforms: Android, iOS Platforms: Android, iOS
> ⚠️ DRM is not supported on visionOS yet
### `filter` ### `filter`
Add video filter Add video filter
@ -237,7 +238,7 @@ Notes:
2. Video filter is currently not supported on HLS playlists. 2. Video filter is currently not supported on HLS playlists.
3. `filterEnabled` must be set to `true` 3. `filterEnabled` must be set to `true`
Platforms: iOS Platforms: iOS, visionOS
### `filterEnabled` ### `filterEnabled`
Enable video filter. Enable video filter.
@ -245,7 +246,7 @@ Enable video filter.
* **false (default)** - Don't enable filter * **false (default)** - Don't enable filter
* **true** - Enable filter * **true** - Enable filter
Platforms: iOS Platforms: iOS, visionOS
### `Focusable` ### `Focusable`
Whether this video view should be focusable with a non-touch input device, eg. receive focus with a hardware keyboard. Whether this video view should be focusable with a non-touch input device, eg. receive focus with a hardware keyboard.
@ -262,12 +263,12 @@ See [presentFullscreenPlayer](#presentfullscreenplayer) for details.
* **false (default)** - Don't display the video in fullscreen * **false (default)** - Don't display the video in fullscreen
* **true** - Display the video in fullscreen * **true** - Display the video in fullscreen
Platforms: iOS, Android Platforms: iOS, Android, visionOS
### `fullscreenAutorotate` ### `fullscreenAutorotate`
If a preferred [fullscreenOrientation](#fullscreenorientation) is set, causes the video to rotate to that orientation but permits rotation of the screen to orientation held by user. Defaults to TRUE. If a preferred [fullscreenOrientation](#fullscreenorientation) is set, causes the video to rotate to that orientation but permits rotation of the screen to orientation held by user. Defaults to TRUE.
Platforms: iOS Platforms: iOS, visionOS
### `fullscreenOrientation` ### `fullscreenOrientation`
@ -275,7 +276,7 @@ Platforms: iOS
* **landscape** * **landscape**
* **portrait** * **portrait**
Platforms: iOS Platforms: iOS, visionOS
### `headers` ### `headers`
Pass headers to the HTTP client. Can be used for authorization. Headers must be a part of the source object. Pass headers to the HTTP client. Can be used for authorization. Headers must be a part of the source object.
@ -307,7 +308,7 @@ Controls the iOS silent switch behavior
* **"ignore"** - Play audio even if the silent switch is set * **"ignore"** - Play audio even if the silent switch is set
* **"obey"** - Don't play audio if the silent switch is set * **"obey"** - Don't play audio if the silent switch is set
Platforms: iOS Platforms: iOS, visionOS
### `maxBitRate` ### `maxBitRate`
Sets the desired limit, in bits per second, of network bandwidth consumption when multiple video streams are available for a playlist. Sets the desired limit, in bits per second, of network bandwidth consumption when multiple video streams are available for a playlist.
@ -319,7 +320,7 @@ Example:
maxBitRate={2000000} // 2 megabits maxBitRate={2000000} // 2 megabits
``` ```
Platforms: Android, iOS Platforms: Android, iOS, visionOS
### `minLoadRetryCount` ### `minLoadRetryCount`
Sets the minimum number of times to retry loading data before failing and reporting an error to the application. Useful to recover from transient internet failures. Sets the minimum number of times to retry loading data before failing and reporting an error to the application. Useful to recover from transient internet failures.
@ -339,7 +340,7 @@ Controls how Audio mix with other apps.
* **"mix"** - Audio from this video mixes with audio from other apps. * **"mix"** - Audio from this video mixes with audio from other apps.
* **"duck"** - Reduces the volume of other apps while audio from this video plays. * **"duck"** - Reduces the volume of other apps while audio from this video plays.
Platforms: iOS Platforms: iOS, visionOS
### `muted` ### `muted`
Controls whether the audio is muted Controls whether the audio is muted
@ -373,14 +374,14 @@ To use this feature on iOS, you must:
* [Enable Background Audio](https://developer.apple.com/library/archive/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionBasics/AudioSessionBasics.html#//apple_ref/doc/uid/TP40007875-CH3-SW3) in your Xcode project * [Enable Background Audio](https://developer.apple.com/library/archive/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionBasics/AudioSessionBasics.html#//apple_ref/doc/uid/TP40007875-CH3-SW3) in your Xcode project
* Set the ignoreSilentSwitch prop to "ignore" * Set the ignoreSilentSwitch prop to "ignore"
Platforms: Android, iOS Platforms: Android, iOS, visionOS
### `playWhenInactive` ### `playWhenInactive`
Determine whether the media should continue playing when notifications or the Control Center are in front of the video. Determine whether the media should continue playing when notifications or the Control Center are in front of the video.
* **false (default)** - Don't continue playing the media * **false (default)** - Don't continue playing the media
* **true** - Continue playing the media * **true** - Continue playing the media
Platforms: iOS Platforms: iOS, visionOS
### `poster` ### `poster`
An image to display while the video is loading An image to display while the video is loading
@ -404,7 +405,7 @@ The duration the player should buffer media from the network ahead of the playhe
Default: 0 Default: 0
Platforms: iOS Platforms: iOS, visionOS
### `preventsDisplaySleepDuringVideoPlayback` ### `preventsDisplaySleepDuringVideoPlayback`
Controls whether or not the display should be allowed to sleep while playing the video. Default is not to allow display to sleep. Controls whether or not the display should be allowed to sleep while playing the video. Default is not to allow display to sleep.
@ -508,7 +509,7 @@ Type | Value | Description
If a track matching the specified Type (and Value if appropriate) is unavailable, the first audio track will be played. If multiple tracks match the criteria, the first match will be used. If a track matching the specified Type (and Value if appropriate) is unavailable, the first audio track will be played. If multiple tracks match the criteria, the first match will be used.
Platforms: Android, iOS Platforms: Android, iOS, visionOS
### `selectedTextTrack` ### `selectedTextTrack`
Configure which text track (caption or subtitle), if any, is shown. Configure which text track (caption or subtitle), if any, is shown.
@ -540,7 +541,7 @@ Both iOS & Android (only 4.4 and higher) offer Settings to enable Captions for h
If a track matching the specified Type (and Value if appropriate) is unavailable, no text track will be displayed. If multiple tracks match the criteria, the first match will be used. If a track matching the specified Type (and Value if appropriate) is unavailable, no text track will be displayed. If multiple tracks match the criteria, the first match will be used.
Platforms: Android, iOS Platforms: Android, iOS, visionOS
### `selectedVideoTrack` ### `selectedVideoTrack`
Configure which video track should be played. By default, the player uses Adaptive Bitrate Streaming to automatically select the stream it thinks will perform best based on available bandwidth. Configure which video track should be played. By default, the player uses Adaptive Bitrate Streaming to automatically select the stream it thinks will perform best based on available bandwidth.
@ -755,7 +756,7 @@ textTracks={[
``` ```
Platforms: Android, iOS Platforms: Android, iOS, visionOS
### `trackId` ### `trackId`
Configure an identifier for the video stream to link the playback context to the events emitted. Configure an identifier for the video stream to link the playback context to the events emitted.

View File

@ -157,6 +157,22 @@ Select RCTVideo-tvOS
</details> </details>
</details> </details>
<details>
<summary>visionOS</summary>
## visionOS
Add patch for `promises` pods to your pod files to make it work with `visionOS` target.
> This patch is required only for `visionOS` target and will be removed in future.
```diff
+ pod 'PromisesSwift', :podspec => '../node_modules/react-native-video/ios/patches/PromisesSwift.podspec'
+ pod 'PromisesObjC', :podspec => '../node_modules/react-native-video/ios/patches/PromisesObjC.podspec'
```
**Remember** to run `pod install` after adding this patch.
After this you can follow the same steps as for `iOS` target.
</details>
## Examples ## Examples
Run `yarn xbasic install` in the root directory before running any of the examples. Run `yarn xbasic install` in the root directory before running any of the examples.