amazon-ivs-react-native-player 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +175 -0
- package/README.md +56 -0
- package/amazon-ivs-react-native-player.podspec +31 -0
- package/android/.project +17 -0
- package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
- package/android/build/.transforms/1f4dbdc38179d2776be8ed38c6bd3b8d/classes/classes.dex +0 -0
- package/android/build/.transforms/1f4dbdc38179d2776be8ed38c6bd3b8d.bin +1 -0
- package/android/build/generated/source/buildConfig/debug/com/amazonaws/ivs/reactnative/player/BuildConfig.java +10 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +20 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +16 -0
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +2 -0
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +1 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/R.txt +1864 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
- package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +1 -0
- package/android/build/intermediates/incremental/packageDebugResources/merger.xml +2 -0
- package/android/build/intermediates/javac/debug/classes/com/amazonaws/ivs/reactnative/player/BuildConfig.class +0 -0
- package/android/build/intermediates/library_java_res/debug/res.jar +0 -0
- package/android/build/intermediates/library_manifest/debug/AndroidManifest.xml +20 -0
- package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +2 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +28 -0
- package/android/build/intermediates/navigation_json/debug/navigation.json +1 -0
- package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +16 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +1384 -0
- package/android/build/kotlin/compileDebugKotlin/build-history.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/counters.tab +2 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/last-build.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +52 -0
- package/android/build/tmp/compileDebugJavaWithJavac/source-classes-mapping.txt +2 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/amazonivsreactnativeplayer_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/amazonaws/ivs/reactnative/player/AmazonIvsPackage.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/amazonaws/ivs/reactnative/player/AmazonIvsView$$special$$inlined$timerTask$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/amazonaws/ivs/reactnative/player/AmazonIvsView$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/amazonaws/ivs/reactnative/player/AmazonIvsView$Events.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/amazonaws/ivs/reactnative/player/AmazonIvsView$WhenMappings.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/amazonaws/ivs/reactnative/player/AmazonIvsView$mLayoutRunnable$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/amazonaws/ivs/reactnative/player/AmazonIvsView.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/amazonaws/ivs/reactnative/player/AmazonIvsViewManager$Commands.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/amazonaws/ivs/reactnative/player/AmazonIvsViewManager.class +0 -0
- package/android/build.gradle +138 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +5 -0
- package/android/gradlew +183 -0
- package/android/gradlew.bat +84 -0
- package/android/src/main/AndroidManifest.xml +11 -0
- package/android/src/main/java/com/amazonaws/ivs/reactnative/player/AmazonIvsPackage.kt +16 -0
- package/android/src/main/java/com/amazonaws/ivs/reactnative/player/AmazonIvsView.kt +410 -0
- package/android/src/main/java/com/amazonaws/ivs/reactnative/player/AmazonIvsViewManager.kt +115 -0
- package/ios/AmazonIvs-Bridging-Header.h +3 -0
- package/ios/AmazonIvs.xcodeproj/project.pbxproj +283 -0
- package/ios/AmazonIvsManager.m +35 -0
- package/ios/AmazonIvsManager.swift +29 -0
- package/ios/AmazonIvsView.swift +414 -0
- package/lib/commonjs/IVSPlayer.js +245 -0
- package/lib/commonjs/IVSPlayer.js.flow +53 -0
- package/lib/commonjs/IVSPlayer.js.map +1 -0
- package/lib/commonjs/enums.js +27 -0
- package/lib/commonjs/enums.js.flow +21 -0
- package/lib/commonjs/enums.js.map +1 -0
- package/lib/commonjs/index.js +43 -0
- package/lib/commonjs/index.js.flow +11 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/types.js +2 -0
- package/lib/commonjs/types.js.flow +44 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/module/IVSPlayer.js +229 -0
- package/lib/module/IVSPlayer.js.flow +53 -0
- package/lib/module/IVSPlayer.js.map +1 -0
- package/lib/module/enums.js +19 -0
- package/lib/module/enums.js.flow +21 -0
- package/lib/module/enums.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.flow +11 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.flow +44 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/IVSPlayer.d.ts +41 -0
- package/lib/typescript/__tests__/index.test.d.ts +1 -0
- package/lib/typescript/enums.d.ts +13 -0
- package/lib/typescript/index.d.ts +4 -0
- package/lib/typescript/types.d.ts +37 -0
- package/package.json +149 -0
- package/src/IVSPlayer.js.flow +53 -0
- package/src/IVSPlayer.tsx +366 -0
- package/src/__tests__/index.test.tsx +226 -0
- package/src/enums.js.flow +21 -0
- package/src/enums.ts +14 -0
- package/src/index.js.flow +11 -0
- package/src/index.ts +5 -0
- package/src/types.js.flow +44 -0
- package/src/types.ts +42 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewStyle } from 'react-native';
|
|
3
|
+
import type { LogLevel, PlayerState } from './enums';
|
|
4
|
+
import type { Quality, PlayerData, TextCue, TextMetadataCue, VideoData, IVSPlayerRef } from './types';
|
|
5
|
+
declare type Props = {
|
|
6
|
+
style?: ViewStyle;
|
|
7
|
+
testID?: string;
|
|
8
|
+
paused?: boolean;
|
|
9
|
+
muted?: boolean;
|
|
10
|
+
autoplay?: boolean;
|
|
11
|
+
streamUrl?: string;
|
|
12
|
+
liveLowLatency?: boolean;
|
|
13
|
+
playbackRate?: number;
|
|
14
|
+
logLevel?: LogLevel;
|
|
15
|
+
progressInterval?: number;
|
|
16
|
+
volume?: number;
|
|
17
|
+
quality?: Quality | null;
|
|
18
|
+
autoMaxQuality?: Quality | null;
|
|
19
|
+
autoQualityMode?: boolean;
|
|
20
|
+
breakpoints?: number[];
|
|
21
|
+
maxBitrate?: number;
|
|
22
|
+
initialBufferDuration?: number;
|
|
23
|
+
onSeek?(position: number): void;
|
|
24
|
+
onData?(data: PlayerData): void;
|
|
25
|
+
onVideoStatistics?(data: VideoData): void;
|
|
26
|
+
onPlayerStateChange?(state: PlayerState): void;
|
|
27
|
+
onDurationChange?(duration: number | null): void;
|
|
28
|
+
onQualityChange?(quality: Quality | null): void;
|
|
29
|
+
onRebuffering?(): void;
|
|
30
|
+
onLoadStart?(): void;
|
|
31
|
+
onLoad?(duration: number | null): void;
|
|
32
|
+
onLiveLatencyChange?(liveLatency: number): void;
|
|
33
|
+
onTextCue?(textCue: TextCue): void;
|
|
34
|
+
onTextMetadataCue?(textMetadataCue: TextMetadataCue): void;
|
|
35
|
+
onProgress?(progress: number): void;
|
|
36
|
+
onError?(error: string): void;
|
|
37
|
+
onTimePoint?(position: number): void;
|
|
38
|
+
children?: React.ReactNode;
|
|
39
|
+
};
|
|
40
|
+
declare const IVSPlayerContainer: React.ForwardRefExoticComponent<Props & React.RefAttributes<IVSPlayerRef>>;
|
|
41
|
+
export default IVSPlayerContainer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum LogLevel {
|
|
2
|
+
IVSLogLevelDebug = 0,
|
|
3
|
+
IVSLogLevelInfo = 1,
|
|
4
|
+
IVSLogLevelWarning = 2,
|
|
5
|
+
IVSLogLevelError = 3
|
|
6
|
+
}
|
|
7
|
+
export declare enum PlayerState {
|
|
8
|
+
Idle = "Idle",
|
|
9
|
+
Ready = "Ready",
|
|
10
|
+
Buffering = "Buffering",
|
|
11
|
+
Playing = "Playing",
|
|
12
|
+
Ended = "Ended"
|
|
13
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare type Quality = {
|
|
2
|
+
name: string;
|
|
3
|
+
codecs: string;
|
|
4
|
+
bitrate: number;
|
|
5
|
+
framerate: number;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
};
|
|
9
|
+
export declare type PlayerData = {
|
|
10
|
+
qualities: Quality[];
|
|
11
|
+
version: string;
|
|
12
|
+
sessionId: string;
|
|
13
|
+
};
|
|
14
|
+
export declare type VideoData = {
|
|
15
|
+
bitrate: number;
|
|
16
|
+
duration: number | null;
|
|
17
|
+
framesDecoded: number | null;
|
|
18
|
+
framesDropped: number | null;
|
|
19
|
+
};
|
|
20
|
+
export declare type TextCue = {
|
|
21
|
+
type: string;
|
|
22
|
+
line: number;
|
|
23
|
+
size: number;
|
|
24
|
+
position: number;
|
|
25
|
+
text: string;
|
|
26
|
+
textAlignment: string;
|
|
27
|
+
};
|
|
28
|
+
export declare type TextMetadataCue = {
|
|
29
|
+
type: string;
|
|
30
|
+
text: string;
|
|
31
|
+
textDescription: string;
|
|
32
|
+
};
|
|
33
|
+
export declare type IVSPlayerRef = {
|
|
34
|
+
play: () => void;
|
|
35
|
+
pause: () => void;
|
|
36
|
+
seekTo: (position: number) => void;
|
|
37
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "amazon-ivs-react-native-player",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "amazon-ivs-react-native-player",
|
|
5
|
+
"main": "lib/commonjs/index",
|
|
6
|
+
"module": "lib/module/index",
|
|
7
|
+
"types": "lib/typescript/index.d.ts",
|
|
8
|
+
"react-native": "src/index",
|
|
9
|
+
"source": "src/index",
|
|
10
|
+
"files": [
|
|
11
|
+
"src",
|
|
12
|
+
"lib",
|
|
13
|
+
"android",
|
|
14
|
+
"ios",
|
|
15
|
+
"cpp",
|
|
16
|
+
"amazon-ivs-react-native-player.podspec"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"test": "jest",
|
|
20
|
+
"typescript": "tsc --noEmit",
|
|
21
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
22
|
+
"prepare": "bob build",
|
|
23
|
+
"example": "yarn --cwd example",
|
|
24
|
+
"pods": "cd example && pod-install --quiet",
|
|
25
|
+
"bootstrap": "yarn example && yarn && yarn pods",
|
|
26
|
+
"e2e:build:android": "detox build --configuration android",
|
|
27
|
+
"e2e:build:ios": "detox build --configuration ios",
|
|
28
|
+
"e2e:test:android": "yarn get:testbutler && detox test --configuration android --take-screenshots failing --loglevel verbose",
|
|
29
|
+
"e2e:test:ios": "detox test --configuration ios --take-screenshots failing --loglevel verbose",
|
|
30
|
+
"e2e:build:android:release": "detox build --configuration android.emu.release",
|
|
31
|
+
"e2e:build:ios:release": "detox build --configuration ios.sim.release",
|
|
32
|
+
"e2e:test:android:release": "yarn get:testbutler && detox test --configuration android.emu.release --headless --take-screenshots failing",
|
|
33
|
+
"e2e:test:ios:release": "detox test --configuration ios.sim.release --take-screenshots failing",
|
|
34
|
+
"get:testbutler": "curl -f -o ./test-butler-app.apk https://repo1.maven.org/maven2/com/linkedin/testbutler/test-butler-app/2.2.1/test-butler-app-2.2.1.apk"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [
|
|
37
|
+
"react-native",
|
|
38
|
+
"ios",
|
|
39
|
+
"android"
|
|
40
|
+
],
|
|
41
|
+
"repository": "https://github.com/aws/amazon-ivs-react-native-player",
|
|
42
|
+
"author": "AWS",
|
|
43
|
+
"license": "Apache-2.0",
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://github.com/aws/amazon-ivs-react-native-player/issues"
|
|
46
|
+
},
|
|
47
|
+
"homepage": "https://github.com/aws/amazon-ivs-react-native-player#readme",
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"registry": "https://registry.npmjs.org/"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@callstack/eslint-config": "^11.0.0",
|
|
53
|
+
"@commitlint/config-conventional": "^13.1.0",
|
|
54
|
+
"@react-native-community/eslint-config": "^2.0.0",
|
|
55
|
+
"@testing-library/jest-native": "^4.0.1",
|
|
56
|
+
"@testing-library/react-native": "^7.2.0",
|
|
57
|
+
"@types/jest": "^26.0.0",
|
|
58
|
+
"@types/react": "^16.9.19",
|
|
59
|
+
"@types/react-native": "0.62.13",
|
|
60
|
+
"commitlint": "^13.1.0",
|
|
61
|
+
"detox": "^18.23.1 ",
|
|
62
|
+
"eslint": "^7.18.0",
|
|
63
|
+
"eslint-config-prettier": "^7.0.0",
|
|
64
|
+
"eslint-plugin-detox": "^1.0.0",
|
|
65
|
+
"eslint-plugin-prettier": "^3.1.3",
|
|
66
|
+
"husky": "^4.2.5",
|
|
67
|
+
"jest": "^27.2.1",
|
|
68
|
+
"jest-circus": "^27.2.1",
|
|
69
|
+
"pod-install": "^0.1.0",
|
|
70
|
+
"prettier": "^2.0.5",
|
|
71
|
+
"react": "17.0.1",
|
|
72
|
+
"react-native": "0.64.2",
|
|
73
|
+
"react-native-builder-bob": "^0.18.1",
|
|
74
|
+
"react-test-renderer": "17.0.1",
|
|
75
|
+
"typescript": "^4.1.3",
|
|
76
|
+
"@babel/runtime": "^7.12.5"
|
|
77
|
+
},
|
|
78
|
+
"peerDependencies": {
|
|
79
|
+
"react": "*",
|
|
80
|
+
"react-native": "*"
|
|
81
|
+
},
|
|
82
|
+
"jest": {
|
|
83
|
+
"preset": "react-native",
|
|
84
|
+
"setupFilesAfterEnv": [
|
|
85
|
+
"@testing-library/jest-native/extend-expect"
|
|
86
|
+
],
|
|
87
|
+
"modulePathIgnorePatterns": [
|
|
88
|
+
"<rootDir>/example/node_modules",
|
|
89
|
+
"<rootDir>/lib/"
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
"husky": {
|
|
93
|
+
"hooks": {
|
|
94
|
+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
|
|
95
|
+
"pre-commit": "yarn lint && yarn typescript"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"commitlint": {
|
|
99
|
+
"extends": [
|
|
100
|
+
"@commitlint/config-conventional"
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
"eslintConfig": {
|
|
104
|
+
"root": true,
|
|
105
|
+
"extends": "@callstack/eslint-config/react",
|
|
106
|
+
"rules": {
|
|
107
|
+
"prettier/prettier": [
|
|
108
|
+
"error",
|
|
109
|
+
{
|
|
110
|
+
"quoteProps": "consistent",
|
|
111
|
+
"singleQuote": true,
|
|
112
|
+
"tabWidth": 2,
|
|
113
|
+
"trailingComma": "es5",
|
|
114
|
+
"useTabs": false
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"import/no-unresolved": "off",
|
|
118
|
+
"import/no-extraneous-dependencies": "off"
|
|
119
|
+
},
|
|
120
|
+
"plugins": [
|
|
121
|
+
"detox"
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
"eslintIgnore": [
|
|
125
|
+
"node_modules/",
|
|
126
|
+
"lib/"
|
|
127
|
+
],
|
|
128
|
+
"prettier": {
|
|
129
|
+
"quoteProps": "consistent",
|
|
130
|
+
"singleQuote": true,
|
|
131
|
+
"tabWidth": 2,
|
|
132
|
+
"trailingComma": "es5",
|
|
133
|
+
"useTabs": false
|
|
134
|
+
},
|
|
135
|
+
"react-native-builder-bob": {
|
|
136
|
+
"source": "src",
|
|
137
|
+
"output": "lib",
|
|
138
|
+
"targets": [
|
|
139
|
+
"commonjs",
|
|
140
|
+
"module",
|
|
141
|
+
[
|
|
142
|
+
"typescript",
|
|
143
|
+
{
|
|
144
|
+
"project": "tsconfig.build.json"
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flowtype definitions for IVSPlayer
|
|
3
|
+
* Generated by Flowgen from a Typescript Definition
|
|
4
|
+
* Flowgen v1.13.0
|
|
5
|
+
* @flow
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
import type { ViewStyleProp } from 'react-native/Libraries/StyleSheet/StyleSheet';
|
|
10
|
+
import typeof { LogLevel } from './enums';
|
|
11
|
+
import type {
|
|
12
|
+
Quality,
|
|
13
|
+
PlayerData,
|
|
14
|
+
TextCue,
|
|
15
|
+
TextMetadataCue,
|
|
16
|
+
VideoData,
|
|
17
|
+
IVSPlayerRef,
|
|
18
|
+
} from './types';
|
|
19
|
+
|
|
20
|
+
declare type Props = {|
|
|
21
|
+
style?: ViewStyleProp,
|
|
22
|
+
paused?: boolean,
|
|
23
|
+
muted?: boolean,
|
|
24
|
+
autoplay?: boolean,
|
|
25
|
+
streamUrl?: string,
|
|
26
|
+
liveLowLatency?: boolean,
|
|
27
|
+
playbackRate?: number,
|
|
28
|
+
logLevel?: LogLevel,
|
|
29
|
+
progressInterval?: number,
|
|
30
|
+
volume?: number,
|
|
31
|
+
quality?: Quality | null,
|
|
32
|
+
autoMaxQuality?: Quality | null,
|
|
33
|
+
autoQualityMode?: boolean,
|
|
34
|
+
breakpoints?: number[],
|
|
35
|
+
maxBitrate?: number,
|
|
36
|
+
onSeek?: (position: number) => void,
|
|
37
|
+
onData?: (data: PlayerData) => void,
|
|
38
|
+
onVideoStatistics?: (data: VideoData) => void,
|
|
39
|
+
onPlayerStateChange?: (state: number) => void,
|
|
40
|
+
onDurationChange?: (duration: number | null) => void,
|
|
41
|
+
onQualityChange?: (quality: Quality | null) => void,
|
|
42
|
+
onRebuffering?: () => void,
|
|
43
|
+
onLoadStart?: () => void,
|
|
44
|
+
onLoad?: (duration: number | null) => void,
|
|
45
|
+
onLiveLatencyChange?: (liveLatency: number) => void,
|
|
46
|
+
onTextCue?: (textCue: TextCue) => void,
|
|
47
|
+
onTextMetadataCue?: (textMetadataCue: TextMetadataCue) => void,
|
|
48
|
+
onProgress?: (progress: number) => void,
|
|
49
|
+
onError?: (error: string) => void,
|
|
50
|
+
onTimePoint?: (position: number) => void,
|
|
51
|
+
|};
|
|
52
|
+
declare var IVSPlayerContainer: React.AbstractComponent<Props, IVSPlayerRef>;
|
|
53
|
+
declare export default typeof IVSPlayerContainer;
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
useCallback,
|
|
3
|
+
useEffect,
|
|
4
|
+
useImperativeHandle,
|
|
5
|
+
useRef,
|
|
6
|
+
} from 'react';
|
|
7
|
+
import {
|
|
8
|
+
requireNativeComponent,
|
|
9
|
+
ViewStyle,
|
|
10
|
+
StyleSheet,
|
|
11
|
+
UIManager,
|
|
12
|
+
findNodeHandle,
|
|
13
|
+
View,
|
|
14
|
+
NativeSyntheticEvent,
|
|
15
|
+
} from 'react-native';
|
|
16
|
+
import type { LogLevel, PlayerState } from './enums';
|
|
17
|
+
import type {
|
|
18
|
+
Quality,
|
|
19
|
+
PlayerData,
|
|
20
|
+
TextCue,
|
|
21
|
+
TextMetadataCue,
|
|
22
|
+
VideoData,
|
|
23
|
+
IVSPlayerRef,
|
|
24
|
+
} from './types';
|
|
25
|
+
|
|
26
|
+
type IVSPlayerProps = {
|
|
27
|
+
style?: ViewStyle;
|
|
28
|
+
testID?: string;
|
|
29
|
+
ref: any;
|
|
30
|
+
muted?: boolean;
|
|
31
|
+
liveLowLatency?: boolean;
|
|
32
|
+
playbackRate?: number;
|
|
33
|
+
streamUrl?: string;
|
|
34
|
+
logLevel?: LogLevel;
|
|
35
|
+
progressInterval?: number;
|
|
36
|
+
volume?: number;
|
|
37
|
+
quality?: Quality | null;
|
|
38
|
+
autoMaxQuality?: Quality | null;
|
|
39
|
+
autoQualityMode?: boolean;
|
|
40
|
+
breakpoints?: number[];
|
|
41
|
+
maxBitrate?: number;
|
|
42
|
+
initialBufferDuration?: number;
|
|
43
|
+
onSeek?(event: NativeSyntheticEvent<{ position: number }>): void;
|
|
44
|
+
onData?(event: NativeSyntheticEvent<{ playerData: PlayerData }>): void;
|
|
45
|
+
onVideoStatistics?(
|
|
46
|
+
event: NativeSyntheticEvent<{ videoData: VideoData }>
|
|
47
|
+
): void;
|
|
48
|
+
onPlayerStateChange?(
|
|
49
|
+
event: NativeSyntheticEvent<{ state: PlayerState }>
|
|
50
|
+
): void;
|
|
51
|
+
onDurationChange?(
|
|
52
|
+
event: NativeSyntheticEvent<{ duration: number | null }>
|
|
53
|
+
): void;
|
|
54
|
+
onQualityChange?(event: NativeSyntheticEvent<{ quality: Quality }>): void;
|
|
55
|
+
onRebuffering?(): void;
|
|
56
|
+
onLoadStart?(): void;
|
|
57
|
+
onLoad?(event: NativeSyntheticEvent<{ duration: number | null }>): void;
|
|
58
|
+
onLiveLatencyChange?(
|
|
59
|
+
event: NativeSyntheticEvent<{ liveLatency: number }>
|
|
60
|
+
): void;
|
|
61
|
+
onTextCue?(event: NativeSyntheticEvent<{ textCue: TextCue }>): void;
|
|
62
|
+
onTextMetadataCue?(
|
|
63
|
+
event: NativeSyntheticEvent<{ textMetadataCue: TextMetadataCue }>
|
|
64
|
+
): void;
|
|
65
|
+
onProgress?(event: NativeSyntheticEvent<{ position: number }>): void;
|
|
66
|
+
onError?(event: NativeSyntheticEvent<{ error: string }>): void;
|
|
67
|
+
onTimePoint?(event: NativeSyntheticEvent<{ position: number }>): void;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const VIEW_NAME = 'AmazonIvs';
|
|
71
|
+
|
|
72
|
+
const IVSPlayer = requireNativeComponent<IVSPlayerProps>(VIEW_NAME);
|
|
73
|
+
|
|
74
|
+
type Props = {
|
|
75
|
+
style?: ViewStyle;
|
|
76
|
+
testID?: string;
|
|
77
|
+
paused?: boolean;
|
|
78
|
+
muted?: boolean;
|
|
79
|
+
autoplay?: boolean;
|
|
80
|
+
streamUrl?: string;
|
|
81
|
+
liveLowLatency?: boolean;
|
|
82
|
+
playbackRate?: number;
|
|
83
|
+
logLevel?: LogLevel;
|
|
84
|
+
progressInterval?: number;
|
|
85
|
+
volume?: number;
|
|
86
|
+
quality?: Quality | null;
|
|
87
|
+
autoMaxQuality?: Quality | null;
|
|
88
|
+
autoQualityMode?: boolean;
|
|
89
|
+
breakpoints?: number[];
|
|
90
|
+
maxBitrate?: number;
|
|
91
|
+
initialBufferDuration?: number;
|
|
92
|
+
onSeek?(position: number): void;
|
|
93
|
+
onData?(data: PlayerData): void;
|
|
94
|
+
onVideoStatistics?(data: VideoData): void;
|
|
95
|
+
onPlayerStateChange?(state: PlayerState): void;
|
|
96
|
+
onDurationChange?(duration: number | null): void;
|
|
97
|
+
onQualityChange?(quality: Quality | null): void;
|
|
98
|
+
onRebuffering?(): void;
|
|
99
|
+
onLoadStart?(): void;
|
|
100
|
+
onLoad?(duration: number | null): void;
|
|
101
|
+
onLiveLatencyChange?(liveLatency: number): void;
|
|
102
|
+
onTextCue?(textCue: TextCue): void;
|
|
103
|
+
onTextMetadataCue?(textMetadataCue: TextMetadataCue): void;
|
|
104
|
+
onProgress?(progress: number): void;
|
|
105
|
+
onError?(error: string): void;
|
|
106
|
+
onTimePoint?(position: number): void;
|
|
107
|
+
children?: React.ReactNode;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
function parseDuration(duration: number | null) {
|
|
111
|
+
if (duration == null) {
|
|
112
|
+
return duration;
|
|
113
|
+
}
|
|
114
|
+
return duration > 0 ? duration : Infinity;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const IVSPlayerContainer = React.forwardRef<IVSPlayerRef, Props>(
|
|
118
|
+
(
|
|
119
|
+
{
|
|
120
|
+
style,
|
|
121
|
+
streamUrl,
|
|
122
|
+
paused,
|
|
123
|
+
muted,
|
|
124
|
+
autoplay = true,
|
|
125
|
+
liveLowLatency,
|
|
126
|
+
playbackRate,
|
|
127
|
+
logLevel,
|
|
128
|
+
progressInterval,
|
|
129
|
+
volume,
|
|
130
|
+
quality,
|
|
131
|
+
autoMaxQuality,
|
|
132
|
+
autoQualityMode,
|
|
133
|
+
breakpoints = [],
|
|
134
|
+
maxBitrate,
|
|
135
|
+
initialBufferDuration,
|
|
136
|
+
onSeek,
|
|
137
|
+
onData,
|
|
138
|
+
onVideoStatistics,
|
|
139
|
+
onPlayerStateChange,
|
|
140
|
+
onDurationChange,
|
|
141
|
+
onQualityChange,
|
|
142
|
+
onRebuffering,
|
|
143
|
+
onLoadStart,
|
|
144
|
+
onLoad,
|
|
145
|
+
onLiveLatencyChange,
|
|
146
|
+
onTextCue,
|
|
147
|
+
onTextMetadataCue,
|
|
148
|
+
onProgress,
|
|
149
|
+
onError,
|
|
150
|
+
onTimePoint,
|
|
151
|
+
children,
|
|
152
|
+
},
|
|
153
|
+
ref
|
|
154
|
+
) => {
|
|
155
|
+
const mediaPlayerRef = useRef(null);
|
|
156
|
+
const initialized = useRef(false);
|
|
157
|
+
|
|
158
|
+
const play = useCallback(() => {
|
|
159
|
+
UIManager.dispatchViewManagerCommand(
|
|
160
|
+
findNodeHandle(mediaPlayerRef.current),
|
|
161
|
+
UIManager.getViewManagerConfig(VIEW_NAME).Commands.play,
|
|
162
|
+
[]
|
|
163
|
+
);
|
|
164
|
+
}, []);
|
|
165
|
+
|
|
166
|
+
const pause = useCallback(() => {
|
|
167
|
+
UIManager.dispatchViewManagerCommand(
|
|
168
|
+
findNodeHandle(mediaPlayerRef.current),
|
|
169
|
+
UIManager.getViewManagerConfig(VIEW_NAME).Commands.pause,
|
|
170
|
+
[]
|
|
171
|
+
);
|
|
172
|
+
}, []);
|
|
173
|
+
|
|
174
|
+
const seekTo = useCallback((value) => {
|
|
175
|
+
UIManager.dispatchViewManagerCommand(
|
|
176
|
+
findNodeHandle(mediaPlayerRef.current),
|
|
177
|
+
|
|
178
|
+
UIManager.getViewManagerConfig(VIEW_NAME).Commands.seekTo,
|
|
179
|
+
[value]
|
|
180
|
+
);
|
|
181
|
+
}, []);
|
|
182
|
+
|
|
183
|
+
useEffect(() => {
|
|
184
|
+
if (initialized.current || autoplay) {
|
|
185
|
+
if (paused) {
|
|
186
|
+
pause();
|
|
187
|
+
} else {
|
|
188
|
+
play();
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
initialized.current = true;
|
|
192
|
+
}, [pause, paused, play, autoplay]);
|
|
193
|
+
|
|
194
|
+
useImperativeHandle(
|
|
195
|
+
ref,
|
|
196
|
+
() => ({
|
|
197
|
+
play,
|
|
198
|
+
pause,
|
|
199
|
+
seekTo,
|
|
200
|
+
}),
|
|
201
|
+
[play, pause, seekTo]
|
|
202
|
+
);
|
|
203
|
+
|
|
204
|
+
const onSeekHandler = (
|
|
205
|
+
event: NativeSyntheticEvent<{ position: number }>
|
|
206
|
+
) => {
|
|
207
|
+
const { position } = event.nativeEvent;
|
|
208
|
+
onSeek?.(position);
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
const onPlayerStateChangeHandler = (
|
|
212
|
+
event: NativeSyntheticEvent<{ state: PlayerState }>
|
|
213
|
+
) => {
|
|
214
|
+
const { state } = event.nativeEvent;
|
|
215
|
+
onPlayerStateChange?.(state);
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
const onDurationChangeHandler = (
|
|
219
|
+
event: NativeSyntheticEvent<{ duration: number | null }>
|
|
220
|
+
) => {
|
|
221
|
+
const { duration } = event.nativeEvent;
|
|
222
|
+
|
|
223
|
+
onDurationChange?.(parseDuration(duration));
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
const onQualityChangeHandler = (
|
|
227
|
+
event: NativeSyntheticEvent<{ quality: Quality }>
|
|
228
|
+
) => {
|
|
229
|
+
const { quality: newQuality } = event.nativeEvent;
|
|
230
|
+
onQualityChange?.(newQuality);
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
const onLoadHandler = (
|
|
234
|
+
event: NativeSyntheticEvent<{
|
|
235
|
+
duration: number | null;
|
|
236
|
+
}>
|
|
237
|
+
) => {
|
|
238
|
+
if (!paused) {
|
|
239
|
+
play();
|
|
240
|
+
} else {
|
|
241
|
+
pause();
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const { duration } = event.nativeEvent;
|
|
245
|
+
|
|
246
|
+
onLoad?.(parseDuration(duration));
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
const onLiveLatencyChangeHandler = (
|
|
250
|
+
event: NativeSyntheticEvent<{ liveLatency: number }>
|
|
251
|
+
) => {
|
|
252
|
+
const { liveLatency } = event.nativeEvent;
|
|
253
|
+
onLiveLatencyChange?.(liveLatency);
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
const onDataHandler = (
|
|
257
|
+
event: NativeSyntheticEvent<{ playerData: PlayerData }>
|
|
258
|
+
) => {
|
|
259
|
+
const { playerData } = event.nativeEvent;
|
|
260
|
+
onData?.(playerData);
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
const onTextCueHandler = (
|
|
264
|
+
event: NativeSyntheticEvent<{ textCue: TextCue }>
|
|
265
|
+
) => {
|
|
266
|
+
const { textCue } = event.nativeEvent;
|
|
267
|
+
onTextCue?.(textCue);
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
const onVideoStatisticsHandler = (
|
|
271
|
+
event: NativeSyntheticEvent<{ videoData: VideoData }>
|
|
272
|
+
) => {
|
|
273
|
+
const { videoData } = event.nativeEvent;
|
|
274
|
+
const statistics: VideoData = {
|
|
275
|
+
...videoData,
|
|
276
|
+
duration: parseDuration(videoData.duration),
|
|
277
|
+
};
|
|
278
|
+
onVideoStatistics?.(statistics);
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
const onTextMetadataCueHandler = (
|
|
282
|
+
event: NativeSyntheticEvent<{ textMetadataCue: TextMetadataCue }>
|
|
283
|
+
) => {
|
|
284
|
+
const { textMetadataCue } = event.nativeEvent;
|
|
285
|
+
onTextMetadataCue?.(textMetadataCue);
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
const onProgressHandler = (
|
|
289
|
+
event: NativeSyntheticEvent<{ position: number }>
|
|
290
|
+
) => {
|
|
291
|
+
const { position } = event.nativeEvent;
|
|
292
|
+
onProgress?.(position);
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
const onErrorHandler = (event: NativeSyntheticEvent<{ error: string }>) => {
|
|
296
|
+
const { error } = event.nativeEvent;
|
|
297
|
+
onError?.(error);
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
const onTimePointHandler = (
|
|
301
|
+
event: NativeSyntheticEvent<{ position: number }>
|
|
302
|
+
) => {
|
|
303
|
+
const { position } = event.nativeEvent;
|
|
304
|
+
onTimePoint?.(position);
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
return (
|
|
308
|
+
<View style={[styles.container, style]} ref={ref as any}>
|
|
309
|
+
<IVSPlayer
|
|
310
|
+
testID="IVSPlayer"
|
|
311
|
+
muted={muted}
|
|
312
|
+
liveLowLatency={liveLowLatency}
|
|
313
|
+
style={styles.mediaPlayer}
|
|
314
|
+
ref={mediaPlayerRef}
|
|
315
|
+
playbackRate={playbackRate}
|
|
316
|
+
streamUrl={streamUrl}
|
|
317
|
+
logLevel={logLevel}
|
|
318
|
+
progressInterval={progressInterval}
|
|
319
|
+
volume={volume}
|
|
320
|
+
quality={quality}
|
|
321
|
+
initialBufferDuration={initialBufferDuration}
|
|
322
|
+
autoMaxQuality={autoMaxQuality}
|
|
323
|
+
autoQualityMode={autoQualityMode}
|
|
324
|
+
breakpoints={breakpoints}
|
|
325
|
+
maxBitrate={maxBitrate}
|
|
326
|
+
onVideoStatistics={
|
|
327
|
+
onVideoStatistics ? onVideoStatisticsHandler : undefined
|
|
328
|
+
}
|
|
329
|
+
onData={onDataHandler}
|
|
330
|
+
onSeek={onSeekHandler}
|
|
331
|
+
onQualityChange={onQualityChangeHandler}
|
|
332
|
+
onPlayerStateChange={onPlayerStateChangeHandler}
|
|
333
|
+
onDurationChange={onDurationChangeHandler}
|
|
334
|
+
onRebuffering={onRebuffering}
|
|
335
|
+
onLoadStart={onLoadStart}
|
|
336
|
+
onLoad={onLoadHandler}
|
|
337
|
+
onTextCue={onTextCueHandler}
|
|
338
|
+
onTextMetadataCue={onTextMetadataCueHandler}
|
|
339
|
+
onProgress={onProgressHandler}
|
|
340
|
+
onLiveLatencyChange={
|
|
341
|
+
onLiveLatencyChange ? onLiveLatencyChangeHandler : undefined
|
|
342
|
+
}
|
|
343
|
+
onError={onErrorHandler}
|
|
344
|
+
onTimePoint={onTimePointHandler}
|
|
345
|
+
/>
|
|
346
|
+
<View style={styles.children}>{children}</View>
|
|
347
|
+
</View>
|
|
348
|
+
);
|
|
349
|
+
}
|
|
350
|
+
);
|
|
351
|
+
|
|
352
|
+
const styles = StyleSheet.create({
|
|
353
|
+
container: {
|
|
354
|
+
flex: 1,
|
|
355
|
+
},
|
|
356
|
+
mediaPlayer: {
|
|
357
|
+
flex: 1,
|
|
358
|
+
},
|
|
359
|
+
children: {
|
|
360
|
+
position: 'absolute',
|
|
361
|
+
width: '100%',
|
|
362
|
+
height: '100%',
|
|
363
|
+
},
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
export default IVSPlayerContainer;
|