From 536bdc474d80fadc68604c2f12a32375bb9e32dd Mon Sep 17 00:00:00 2001 From: Hampton Maxwell Date: Mon, 3 Sep 2018 19:01:12 -0700 Subject: [PATCH] Begin documenting the source prop --- README.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/README.md b/README.md index 4d15b336..3eadc143 100644 --- a/README.md +++ b/README.md @@ -241,6 +241,7 @@ var styles = StyleSheet.create({ * [resizeMode](#resizemode) * [selectedAudioTrack](#selectedaudiotrack) * [selectedTextTrack](#selectedtexttrack) +* [source](#source) * [stereoPan](#stereopan) * [textTracks](#texttracks) * [useTextureView](#usetextureview) @@ -456,6 +457,63 @@ If a track matching the specified Type (and Value if appropriate) is unavailable Platforms: Android ExoPlayer, iOS +#### source +Sets the media source. You can pass an asset loaded via require or an object with a uri. + +The docs for this prop are incomplete and will be updated as each option is investigated and tested. + +##### Asset loaded via require + +Example: +``` +const sintel = require('./sintel.mp4'); + +source={sintel} +``` + +##### URI string + +A number of URI schemes are supported by passing an object with a `uri` attribute. + +###### Web address (http://, https://) + +Example: +``` +source={ uri: 'https://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_10mb.mp4' } +``` + +Platforms: all + +###### File path (file://) + +Example: +``` +source={ uri: 'file:///sdcard/Movies/sintel.mp4' } +``` + +Note: Your app will need to request permission to read external storage if you're accessing a file outside your app. + +Platforms: Android ExoPlayer, Android MediaPlayer, possibly others + +###### iPod Library (ipod-library://) + +Path to a sound file in your iTunes library. Typically shared from iTunes to your app. + +Example: +``` +source={ uri: 'ipod-library:///path/to/music.mp3' } +``` + +Note: Using this feature adding an entry for NSAppleMusicUsageDescription to your Info.plist file as described [here](https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html) + +Platforms: iOS + +###### Other protocols + +The following other types are supported on some platforms, but aren't fully documented yet: +`content://, ms-appx://, ms-appdata://, assets-library://` + + #### stereoPan Adjust the balance of the left and right audio channels. Any value between –1.0 and 1.0 is accepted. * **-1.0** - Full left