iOS Swift Conversion (#2527)

Converts iOS implementation from Objective-c to Swift

# During the conversion process some updates to the code structure were also made
- Modularize codebase from single file to smaller focused files
- Untangled large nested IF statements
- Added more null checks, since Swift is more strict with null pointers
- Added property to allow for decoding of local video sources with self contained key for offline playback
- Updates example apps to test react-native 0.63.4 and uses auto native dependency imports for android and ios
This commit is contained in:
Nick Fujita
2022-05-19 22:29:25 +09:00
committed by GitHub
parent d681e5505f
commit 68b9db4d11
138 changed files with 8869 additions and 7589 deletions

View File

@@ -48,16 +48,17 @@ class VideoPlayer extends Component {
seekerWidth = 0
srcList = [
require('./broadchurch.mp4'),
{
description: 'subtitles',
uri: 'https://bitmovin-a.akamaihd.net/content/sintel/sintel.mpd',
},
{
description: 'demo with sintel Subtitles',
uri:
'http://www.youtube.com/api/manifest/dash/id/bf5bb2419360daf1/source/youtube?as=fmp4_audio_clear,fmp4_sd_hd_clear&sparams=ip,ipbits,expire,source,id,as&ip=0.0.0.0&ipbits=0&expire=19000000000&signature=51AF5F39AB0CEC3E5497CD9C900EBFEAECCCB5C7.8506521BFC350652163895D4C26DEE124209AA9E&key=ik0',
type: 'mpd',
},
{
description: 'subtitles',
uri: 'https://bitmovin-a.akamaihd.net/content/sintel/sintel.mpd',
},
{ description: 'Stopped playback', uri: undefined },
{
description: 'no View',
@@ -521,7 +522,7 @@ class VideoPlayer extends Component {
{this.IndicatorLoadingView()}
<View style={styles.topControls}>
<Text style={[styles.controlOption]}>
{this.srcList[this.state.srcListId]?.description}
{this.srcList[this.state.srcListId]?.description || 'local file'}
</Text>
</View>
<View style={styles.leftControls}>
@@ -814,4 +815,4 @@ const styles = StyleSheet.create({
},
});
export default VideoPlayer
export default VideoPlayer