VEX-5044: Allow exoplayer to preinit with empty source (#6)

- Allow player to be init before source is provided, and later update once a source is provided.
- Adds handling for providing a empty source in order to stop playback and clear out any existing content
This commit is contained in:
Nick Fujita
2021-06-30 10:24:21 +09:00
committed by GitHub
parent 80873102a4
commit cba88fa9d8
3 changed files with 21 additions and 4 deletions

View File

@@ -770,6 +770,12 @@ Platforms: Android ExoPlayer
#### source
Sets the media source. You can pass an asset loaded via require or an object with a uri.
Setting the source will trigger the player to attempt to load the provided media with all other given props. Please be sure that all props are provided before/at the same time as setting the source.
Rendering the player component with a null source will init the player, and start playing once a source value is provided.
Providing a null source value after loading a previous source will stop playback, and clear out the previous source content.
The docs for this prop are incomplete and will be updated as each option is investigated and tested.