bitmovin-player-react-native 0.1.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 +21 -0
- package/README.md +274 -0
- package/RNBitmovinPlayer.podspec +23 -0
- package/android/build.gradle +55 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/PlayerModule.kt +279 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerView.kt +264 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerViewManager.kt +139 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerViewPackage.kt +33 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt +162 -0
- package/android/src/main/java/com/bitmovin/player/reactnative/extensions/Events.kt +15 -0
- package/ios/Event+JSON.swift +132 -0
- package/ios/PlayerModule.m +61 -0
- package/ios/PlayerModule.swift +347 -0
- package/ios/RCTConvert+BitmovinPlayer.swift +79 -0
- package/ios/RNBitmovinPlayer.h +7 -0
- package/ios/RNBitmovinPlayer.xcodeproj/project.pbxproj +303 -0
- package/ios/RNPlayerView+PlayerListener.swift +83 -0
- package/ios/RNPlayerView.swift +50 -0
- package/ios/RNPlayerViewManager.m +29 -0
- package/ios/RNPlayerViewManager.swift +60 -0
- package/lib/index.d.ts +486 -0
- package/lib/index.js +218 -0
- package/lib/index.mjs +191 -0
- package/package.json +82 -0
- package/src/components/PlayerView/events.ts +69 -0
- package/src/components/PlayerView/index.tsx +106 -0
- package/src/components/PlayerView/native.ts +17 -0
- package/src/components/index.ts +1 -0
- package/src/events.ts +184 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/usePlayer.ts +10 -0
- package/src/hooks/useProxy.ts +36 -0
- package/src/index.ts +5 -0
- package/src/player.ts +229 -0
- package/src/source.ts +95 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
// !$*UTF8*$!
|
|
2
|
+
{
|
|
3
|
+
archiveVersion = 1;
|
|
4
|
+
classes = {
|
|
5
|
+
};
|
|
6
|
+
objectVersion = 46;
|
|
7
|
+
objects = {
|
|
8
|
+
|
|
9
|
+
/* Begin PBXBuildFile section */
|
|
10
|
+
4C07F4B32849189E009823F1 /* RNPlayerViewManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C07F4B22849189D009823F1 /* RNPlayerViewManager.swift */; };
|
|
11
|
+
4C105DDE284915FA00A45356 /* RCTConvert+Bitmovin.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C105DDB284915FA00A45356 /* RCTConvert+Bitmovin.m */; };
|
|
12
|
+
4C105DDF284915FA00A45356 /* RNPlayerViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C105DDD284915FA00A45356 /* RNPlayerViewManager.m */; };
|
|
13
|
+
4CB3DF2C285B6B7200797619 /* Logging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CB3DF2B285B6B7200797619 /* Logging.swift */; };
|
|
14
|
+
4CB3DF30285B6B8D00797619 /* RNPlayerView+PlayerListener.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CB3DF2D285B6B8D00797619 /* RNPlayerView+PlayerListener.swift */; };
|
|
15
|
+
4CB3DF31285B6B8D00797619 /* RNPlayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CB3DF2E285B6B8D00797619 /* RNPlayerView.swift */; };
|
|
16
|
+
4CB3DF32285B6B8D00797619 /* Event+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CB3DF2F285B6B8D00797619 /* Event+Extensions.swift */; };
|
|
17
|
+
/* End PBXBuildFile section */
|
|
18
|
+
|
|
19
|
+
/* Begin PBXCopyFilesBuildPhase section */
|
|
20
|
+
58B511D91A9E6C8500147676 /* CopyFiles */ = {
|
|
21
|
+
isa = PBXCopyFilesBuildPhase;
|
|
22
|
+
buildActionMask = 2147483647;
|
|
23
|
+
dstPath = "include/$(PRODUCT_NAME)";
|
|
24
|
+
dstSubfolderSpec = 16;
|
|
25
|
+
files = (
|
|
26
|
+
);
|
|
27
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
28
|
+
};
|
|
29
|
+
/* End PBXCopyFilesBuildPhase section */
|
|
30
|
+
|
|
31
|
+
/* Begin PBXFileReference section */
|
|
32
|
+
134814201AA4EA6300B7C361 /* libRNBitmovinPlayer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNBitmovinPlayer.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
33
|
+
4C07F4B22849189D009823F1 /* RNPlayerViewManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RNPlayerViewManager.swift; sourceTree = "<group>"; };
|
|
34
|
+
4C105DDB284915FA00A45356 /* RCTConvert+Bitmovin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTConvert+Bitmovin.m"; sourceTree = "<group>"; };
|
|
35
|
+
4C105DDC284915FA00A45356 /* RCTConvert+Bitmovin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RCTConvert+Bitmovin.h"; sourceTree = "<group>"; };
|
|
36
|
+
4C105DDD284915FA00A45356 /* RNPlayerViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNPlayerViewManager.m; sourceTree = "<group>"; };
|
|
37
|
+
4C105DE02849164B00A45356 /* RNBitmovinPlayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNBitmovinPlayer.h; sourceTree = "<group>"; };
|
|
38
|
+
4CB3DF2B285B6B7200797619 /* Logging.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Logging.swift; sourceTree = "<group>"; };
|
|
39
|
+
4CB3DF2D285B6B8D00797619 /* RNPlayerView+PlayerListener.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "RNPlayerView+PlayerListener.swift"; sourceTree = "<group>"; };
|
|
40
|
+
4CB3DF2E285B6B8D00797619 /* RNPlayerView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RNPlayerView.swift; sourceTree = "<group>"; };
|
|
41
|
+
4CB3DF2F285B6B8D00797619 /* Event+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Event+Extensions.swift"; sourceTree = "<group>"; };
|
|
42
|
+
/* End PBXFileReference section */
|
|
43
|
+
|
|
44
|
+
/* Begin PBXFrameworksBuildPhase section */
|
|
45
|
+
58B511D81A9E6C8500147676 /* Frameworks */ = {
|
|
46
|
+
isa = PBXFrameworksBuildPhase;
|
|
47
|
+
buildActionMask = 2147483647;
|
|
48
|
+
files = (
|
|
49
|
+
);
|
|
50
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
51
|
+
};
|
|
52
|
+
/* End PBXFrameworksBuildPhase section */
|
|
53
|
+
|
|
54
|
+
/* Begin PBXGroup section */
|
|
55
|
+
134814211AA4EA7D00B7C361 /* Products */ = {
|
|
56
|
+
isa = PBXGroup;
|
|
57
|
+
children = (
|
|
58
|
+
134814201AA4EA6300B7C361 /* libRNBitmovinPlayer.a */,
|
|
59
|
+
);
|
|
60
|
+
name = Products;
|
|
61
|
+
sourceTree = "<group>";
|
|
62
|
+
};
|
|
63
|
+
58B511D21A9E6C8500147676 = {
|
|
64
|
+
isa = PBXGroup;
|
|
65
|
+
children = (
|
|
66
|
+
4CB3DF2B285B6B7200797619 /* Logging.swift */,
|
|
67
|
+
4CB3DF2F285B6B8D00797619 /* Event+Extensions.swift */,
|
|
68
|
+
4CB3DF2E285B6B8D00797619 /* RNPlayerView.swift */,
|
|
69
|
+
4CB3DF2D285B6B8D00797619 /* RNPlayerView+PlayerListener.swift */,
|
|
70
|
+
4C07F4B22849189D009823F1 /* RNPlayerViewManager.swift */,
|
|
71
|
+
4C105DE02849164B00A45356 /* RNBitmovinPlayer.h */,
|
|
72
|
+
4C105DDC284915FA00A45356 /* RCTConvert+Bitmovin.h */,
|
|
73
|
+
4C105DDB284915FA00A45356 /* RCTConvert+Bitmovin.m */,
|
|
74
|
+
4C105DDD284915FA00A45356 /* RNPlayerViewManager.m */,
|
|
75
|
+
134814211AA4EA7D00B7C361 /* Products */,
|
|
76
|
+
);
|
|
77
|
+
sourceTree = "<group>";
|
|
78
|
+
};
|
|
79
|
+
/* End PBXGroup section */
|
|
80
|
+
|
|
81
|
+
/* Begin PBXNativeTarget section */
|
|
82
|
+
58B511DA1A9E6C8500147676 /* RNBitmovinPlayer */ = {
|
|
83
|
+
isa = PBXNativeTarget;
|
|
84
|
+
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNBitmovinPlayer" */;
|
|
85
|
+
buildPhases = (
|
|
86
|
+
58B511D71A9E6C8500147676 /* Sources */,
|
|
87
|
+
58B511D81A9E6C8500147676 /* Frameworks */,
|
|
88
|
+
58B511D91A9E6C8500147676 /* CopyFiles */,
|
|
89
|
+
);
|
|
90
|
+
buildRules = (
|
|
91
|
+
);
|
|
92
|
+
dependencies = (
|
|
93
|
+
);
|
|
94
|
+
name = RNBitmovinPlayer;
|
|
95
|
+
productName = RCTDataManager;
|
|
96
|
+
productReference = 134814201AA4EA6300B7C361 /* libRNBitmovinPlayer.a */;
|
|
97
|
+
productType = "com.apple.product-type.library.static";
|
|
98
|
+
};
|
|
99
|
+
/* End PBXNativeTarget section */
|
|
100
|
+
|
|
101
|
+
/* Begin PBXProject section */
|
|
102
|
+
58B511D31A9E6C8500147676 /* Project object */ = {
|
|
103
|
+
isa = PBXProject;
|
|
104
|
+
attributes = {
|
|
105
|
+
LastUpgradeCheck = 0920;
|
|
106
|
+
ORGANIZATIONNAME = Facebook;
|
|
107
|
+
TargetAttributes = {
|
|
108
|
+
58B511DA1A9E6C8500147676 = {
|
|
109
|
+
CreatedOnToolsVersion = 6.1.1;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNBitmovinPlayer" */;
|
|
114
|
+
compatibilityVersion = "Xcode 3.2";
|
|
115
|
+
developmentRegion = English;
|
|
116
|
+
hasScannedForEncodings = 0;
|
|
117
|
+
knownRegions = (
|
|
118
|
+
English,
|
|
119
|
+
en,
|
|
120
|
+
);
|
|
121
|
+
mainGroup = 58B511D21A9E6C8500147676;
|
|
122
|
+
productRefGroup = 58B511D21A9E6C8500147676;
|
|
123
|
+
projectDirPath = "";
|
|
124
|
+
projectRoot = "";
|
|
125
|
+
targets = (
|
|
126
|
+
58B511DA1A9E6C8500147676 /* RNBitmovinPlayer */,
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
/* End PBXProject section */
|
|
130
|
+
|
|
131
|
+
/* Begin PBXSourcesBuildPhase section */
|
|
132
|
+
58B511D71A9E6C8500147676 /* Sources */ = {
|
|
133
|
+
isa = PBXSourcesBuildPhase;
|
|
134
|
+
buildActionMask = 2147483647;
|
|
135
|
+
files = (
|
|
136
|
+
4C105DDE284915FA00A45356 /* RCTConvert+Bitmovin.m in Sources */,
|
|
137
|
+
4C07F4B32849189E009823F1 /* RNPlayerViewManager.swift in Sources */,
|
|
138
|
+
4CB3DF32285B6B8D00797619 /* Event+Extensions.swift in Sources */,
|
|
139
|
+
4C105DDF284915FA00A45356 /* RNPlayerViewManager.m in Sources */,
|
|
140
|
+
4CB3DF31285B6B8D00797619 /* RNPlayerView.swift in Sources */,
|
|
141
|
+
4CB3DF30285B6B8D00797619 /* RNPlayerView+PlayerListener.swift in Sources */,
|
|
142
|
+
4CB3DF2C285B6B7200797619 /* Logging.swift in Sources */,
|
|
143
|
+
);
|
|
144
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
145
|
+
};
|
|
146
|
+
/* End PBXSourcesBuildPhase section */
|
|
147
|
+
|
|
148
|
+
/* Begin XCBuildConfiguration section */
|
|
149
|
+
58B511ED1A9E6C8500147676 /* Debug */ = {
|
|
150
|
+
isa = XCBuildConfiguration;
|
|
151
|
+
buildSettings = {
|
|
152
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
153
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
154
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
155
|
+
CLANG_ENABLE_MODULES = YES;
|
|
156
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
157
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
158
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
159
|
+
CLANG_WARN_COMMA = YES;
|
|
160
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
161
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
162
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
163
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
164
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
165
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
166
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
167
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
168
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
169
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
170
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
171
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
172
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
173
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
174
|
+
COPY_PHASE_STRIP = NO;
|
|
175
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
176
|
+
ENABLE_TESTABILITY = YES;
|
|
177
|
+
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
178
|
+
GCC_DYNAMIC_NO_PIC = NO;
|
|
179
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
|
180
|
+
GCC_OPTIMIZATION_LEVEL = 0;
|
|
181
|
+
GCC_PREPROCESSOR_DEFINITIONS = (
|
|
182
|
+
"DEBUG=1",
|
|
183
|
+
"$(inherited)",
|
|
184
|
+
);
|
|
185
|
+
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
|
186
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
187
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
188
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
189
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
190
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
191
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
192
|
+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
193
|
+
MTL_ENABLE_DEBUG_INFO = YES;
|
|
194
|
+
ONLY_ACTIVE_ARCH = YES;
|
|
195
|
+
SDKROOT = iphoneos;
|
|
196
|
+
};
|
|
197
|
+
name = Debug;
|
|
198
|
+
};
|
|
199
|
+
58B511EE1A9E6C8500147676 /* Release */ = {
|
|
200
|
+
isa = XCBuildConfiguration;
|
|
201
|
+
buildSettings = {
|
|
202
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
203
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
204
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
205
|
+
CLANG_ENABLE_MODULES = YES;
|
|
206
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
207
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
208
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
209
|
+
CLANG_WARN_COMMA = YES;
|
|
210
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
211
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
212
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
213
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
214
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
215
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
216
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
217
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
218
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
219
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
220
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
221
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
222
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
223
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
224
|
+
COPY_PHASE_STRIP = YES;
|
|
225
|
+
ENABLE_NS_ASSERTIONS = NO;
|
|
226
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
227
|
+
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
228
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
|
229
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
230
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
231
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
232
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
233
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
234
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
235
|
+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
236
|
+
MTL_ENABLE_DEBUG_INFO = NO;
|
|
237
|
+
SDKROOT = iphoneos;
|
|
238
|
+
VALIDATE_PRODUCT = YES;
|
|
239
|
+
};
|
|
240
|
+
name = Release;
|
|
241
|
+
};
|
|
242
|
+
58B511F01A9E6C8500147676 /* Debug */ = {
|
|
243
|
+
isa = XCBuildConfiguration;
|
|
244
|
+
buildSettings = {
|
|
245
|
+
HEADER_SEARCH_PATHS = (
|
|
246
|
+
"$(inherited)",
|
|
247
|
+
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
248
|
+
"$(SRCROOT)/../../../React/**",
|
|
249
|
+
"$(SRCROOT)/../../react-native/React/**",
|
|
250
|
+
);
|
|
251
|
+
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
252
|
+
OTHER_LDFLAGS = "-ObjC";
|
|
253
|
+
PRODUCT_NAME = RNBitmovinPlayer;
|
|
254
|
+
SKIP_INSTALL = YES;
|
|
255
|
+
SWIFT_OBJC_BRIDGING_HEADER = "RNBitmovinPlayer-Bridging-Header.h";
|
|
256
|
+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
|
257
|
+
SWIFT_VERSION = 5.0;
|
|
258
|
+
};
|
|
259
|
+
name = Debug;
|
|
260
|
+
};
|
|
261
|
+
58B511F11A9E6C8500147676 /* Release */ = {
|
|
262
|
+
isa = XCBuildConfiguration;
|
|
263
|
+
buildSettings = {
|
|
264
|
+
HEADER_SEARCH_PATHS = (
|
|
265
|
+
"$(inherited)",
|
|
266
|
+
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
267
|
+
"$(SRCROOT)/../../../React/**",
|
|
268
|
+
"$(SRCROOT)/../../react-native/React/**",
|
|
269
|
+
);
|
|
270
|
+
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
271
|
+
OTHER_LDFLAGS = "-ObjC";
|
|
272
|
+
PRODUCT_NAME = RNBitmovinPlayer;
|
|
273
|
+
SKIP_INSTALL = YES;
|
|
274
|
+
SWIFT_OBJC_BRIDGING_HEADER = "RNBitmovinPlayer-Bridging-Header.h";
|
|
275
|
+
SWIFT_VERSION = 5.0;
|
|
276
|
+
};
|
|
277
|
+
name = Release;
|
|
278
|
+
};
|
|
279
|
+
/* End XCBuildConfiguration section */
|
|
280
|
+
|
|
281
|
+
/* Begin XCConfigurationList section */
|
|
282
|
+
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNBitmovinPlayer" */ = {
|
|
283
|
+
isa = XCConfigurationList;
|
|
284
|
+
buildConfigurations = (
|
|
285
|
+
58B511ED1A9E6C8500147676 /* Debug */,
|
|
286
|
+
58B511EE1A9E6C8500147676 /* Release */,
|
|
287
|
+
);
|
|
288
|
+
defaultConfigurationIsVisible = 0;
|
|
289
|
+
defaultConfigurationName = Release;
|
|
290
|
+
};
|
|
291
|
+
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNBitmovinPlayer" */ = {
|
|
292
|
+
isa = XCConfigurationList;
|
|
293
|
+
buildConfigurations = (
|
|
294
|
+
58B511F01A9E6C8500147676 /* Debug */,
|
|
295
|
+
58B511F11A9E6C8500147676 /* Release */,
|
|
296
|
+
);
|
|
297
|
+
defaultConfigurationIsVisible = 0;
|
|
298
|
+
defaultConfigurationName = Release;
|
|
299
|
+
};
|
|
300
|
+
/* End XCConfigurationList section */
|
|
301
|
+
};
|
|
302
|
+
rootObject = 58B511D31A9E6C8500147676 /* Project object */;
|
|
303
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import BitmovinPlayer
|
|
2
|
+
|
|
3
|
+
extension RNPlayerView: PlayerListener {
|
|
4
|
+
func onEvent(_ event: Event, player: Player) {
|
|
5
|
+
onEvent?(event.toJSON())
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
func onPlayerActive(_ event: PlayerActiveEvent, player: Player) {
|
|
9
|
+
onPlayerActive?(event.toJSON())
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
func onPlayerError(_ event: PlayerErrorEvent, player: Player) {
|
|
13
|
+
onPlayerError?(event.toJSON())
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
func onPlayerWarning(_ event: PlayerWarningEvent, player: Player) {
|
|
17
|
+
onPlayerWarning?(event.toJSON())
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
func onDestroy(_ event: DestroyEvent, player: Player) {
|
|
21
|
+
onDestroy?(event.toJSON())
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
func onMuted(_ event: MutedEvent, player: Player) {
|
|
25
|
+
onMuted?(event.toJSON())
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
func onUnmuted(_ event: UnmutedEvent, player: Player) {
|
|
29
|
+
onUnmuted?(event.toJSON())
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
func onReady(_ event: ReadyEvent, player: Player) {
|
|
33
|
+
onReady?(event.toJSON())
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
func onPaused(_ event: PausedEvent, player: Player) {
|
|
37
|
+
onPaused?(event.toJSON())
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
func onPlay(_ event: PlayEvent, player: Player) {
|
|
41
|
+
onPlay?(event.toJSON())
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
func onPlaying(_ event: PlayingEvent, player: Player) {
|
|
45
|
+
onPlaying?(event.toJSON())
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
func onPlaybackFinished(_ event: PlaybackFinishedEvent, player: Player) {
|
|
49
|
+
onPlaybackFinished?(event.toJSON())
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
func onSeek(_ event: SeekEvent, player: Player) {
|
|
53
|
+
onSeek?(event.toJSON())
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
func onSeeked(_ event: SeekedEvent, player: Player) {
|
|
57
|
+
onSeeked?(event.toJSON())
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
func onTimeChanged(_ event: TimeChangedEvent, player: Player) {
|
|
61
|
+
onTimeChanged?(event.toJSON())
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
func onSourceLoad(_ event: SourceLoadEvent, player: Player) {
|
|
65
|
+
onSourceLoad?(event.toJSON())
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
func onSourceLoaded(_ event: SourceLoadedEvent, player: Player) {
|
|
69
|
+
onSourceLoaded?(event.toJSON())
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
func onSourceUnloaded(_ event: SourceUnloadedEvent, player: Player) {
|
|
73
|
+
onSourceUnloaded?(event.toJSON())
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
func onSourceError(_ event: SourceErrorEvent, player: Player) {
|
|
77
|
+
onSourceError?(event.toJSON())
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
func onSourceWarning(_ event: SourceWarningEvent, player: Player) {
|
|
81
|
+
onSourceWarning?(event.toJSON())
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import BitmovinPlayer
|
|
2
|
+
|
|
3
|
+
@objc(RNPlayerView)
|
|
4
|
+
class RNPlayerView: UIView {
|
|
5
|
+
/// Component events.
|
|
6
|
+
@objc var onEvent: RCTBubblingEventBlock?
|
|
7
|
+
@objc var onPlayerActive: RCTBubblingEventBlock?
|
|
8
|
+
@objc var onPlayerError: RCTBubblingEventBlock?
|
|
9
|
+
@objc var onPlayerWarning: RCTBubblingEventBlock?
|
|
10
|
+
@objc var onDestroy: RCTBubblingEventBlock?
|
|
11
|
+
@objc var onMuted: RCTBubblingEventBlock?
|
|
12
|
+
@objc var onUnmuted: RCTBubblingEventBlock?
|
|
13
|
+
@objc var onReady: RCTBubblingEventBlock?
|
|
14
|
+
@objc var onPaused: RCTBubblingEventBlock?
|
|
15
|
+
@objc var onPlay: RCTBubblingEventBlock?
|
|
16
|
+
@objc var onPlaying: RCTBubblingEventBlock?
|
|
17
|
+
@objc var onPlaybackFinished: RCTBubblingEventBlock?
|
|
18
|
+
@objc var onSeek: RCTBubblingEventBlock?
|
|
19
|
+
@objc var onSeeked: RCTBubblingEventBlock?
|
|
20
|
+
@objc var onTimeChanged: RCTBubblingEventBlock?
|
|
21
|
+
@objc var onSourceLoad: RCTBubblingEventBlock?
|
|
22
|
+
@objc var onSourceLoaded: RCTBubblingEventBlock?
|
|
23
|
+
@objc var onSourceUnloaded: RCTBubblingEventBlock?
|
|
24
|
+
@objc var onSourceError: RCTBubblingEventBlock?
|
|
25
|
+
@objc var onSourceWarning: RCTBubblingEventBlock?
|
|
26
|
+
|
|
27
|
+
/// Bitmovin's player view.
|
|
28
|
+
/// Get's initialized when there's a player instance ready to be used.
|
|
29
|
+
var playerView: PlayerView? {
|
|
30
|
+
willSet {
|
|
31
|
+
newValue?.autoresizingMask = [
|
|
32
|
+
.flexibleWidth,
|
|
33
|
+
.flexibleHeight
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
didSet {
|
|
37
|
+
if let playerView = playerView {
|
|
38
|
+
addSubview(playerView)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
init() {
|
|
44
|
+
super.init(frame: .zero)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
required init?(coder: NSCoder) {
|
|
48
|
+
super.init(coder: coder)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#import <React/RCTViewManager.h>
|
|
2
|
+
|
|
3
|
+
@interface RCT_EXTERN_REMAP_MODULE(NativePlayerView, RNPlayerViewManager, RCTViewManager)
|
|
4
|
+
|
|
5
|
+
RCT_EXPORT_VIEW_PROPERTY(onEvent, RCTBubblingEventBlock)
|
|
6
|
+
RCT_EXPORT_VIEW_PROPERTY(onPlayerActive, RCTBubblingEventBlock)
|
|
7
|
+
RCT_EXPORT_VIEW_PROPERTY(onPlayerError, RCTBubblingEventBlock)
|
|
8
|
+
RCT_EXPORT_VIEW_PROPERTY(onPlayerWarning, RCTBubblingEventBlock)
|
|
9
|
+
RCT_EXPORT_VIEW_PROPERTY(onDestroy, RCTBubblingEventBlock)
|
|
10
|
+
RCT_EXPORT_VIEW_PROPERTY(onMuted, RCTBubblingEventBlock)
|
|
11
|
+
RCT_EXPORT_VIEW_PROPERTY(onUnmuted, RCTBubblingEventBlock)
|
|
12
|
+
RCT_EXPORT_VIEW_PROPERTY(onReady, RCTBubblingEventBlock)
|
|
13
|
+
RCT_EXPORT_VIEW_PROPERTY(onPaused, RCTBubblingEventBlock)
|
|
14
|
+
RCT_EXPORT_VIEW_PROPERTY(onPlay, RCTBubblingEventBlock)
|
|
15
|
+
RCT_EXPORT_VIEW_PROPERTY(onPlaying, RCTBubblingEventBlock)
|
|
16
|
+
RCT_EXPORT_VIEW_PROPERTY(onPlaybackFinished, RCTBubblingEventBlock)
|
|
17
|
+
RCT_EXPORT_VIEW_PROPERTY(onSeek, RCTBubblingEventBlock)
|
|
18
|
+
RCT_EXPORT_VIEW_PROPERTY(onSeeked, RCTBubblingEventBlock)
|
|
19
|
+
RCT_EXPORT_VIEW_PROPERTY(onTimeChanged, RCTBubblingEventBlock)
|
|
20
|
+
RCT_EXPORT_VIEW_PROPERTY(onSourceLoad, RCTBubblingEventBlock)
|
|
21
|
+
RCT_EXPORT_VIEW_PROPERTY(onSourceLoaded, RCTBubblingEventBlock)
|
|
22
|
+
RCT_EXPORT_VIEW_PROPERTY(onSourceUnloaded, RCTBubblingEventBlock)
|
|
23
|
+
RCT_EXPORT_VIEW_PROPERTY(onSourceError, RCTBubblingEventBlock)
|
|
24
|
+
RCT_EXPORT_VIEW_PROPERTY(onSourceWarning, RCTBubblingEventBlock)
|
|
25
|
+
|
|
26
|
+
RCT_EXTERN_METHOD(attachPlayer:(nonnull NSNumber *)viewId playerId:(NSString *)playerId)
|
|
27
|
+
RCT_EXTERN_METHOD(detachPlayer:(nonnull NSNumber *)viewId playerId:(NSString *)playerId)
|
|
28
|
+
|
|
29
|
+
@end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import BitmovinPlayer
|
|
2
|
+
import Foundation
|
|
3
|
+
|
|
4
|
+
@objc(RNPlayerViewManager)
|
|
5
|
+
class RNPlayerViewManager: RCTViewManager {
|
|
6
|
+
/// Register module to be initialized on the main thread.
|
|
7
|
+
override class func requiresMainQueueSetup() -> Bool {
|
|
8
|
+
true
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/// `UIView` factory function. It gets called for each `<NativePlayerView />` component
|
|
12
|
+
/// from React.
|
|
13
|
+
override func view() -> UIView! {
|
|
14
|
+
RNPlayerView()
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
Sets the `Player` instance for the view with `viewId` inside RN's `UIManager` registry.
|
|
19
|
+
- Parameter viewId: `RNPlayerView` id inside `UIManager`'s registry.
|
|
20
|
+
- Parameter playerId: `Player` instance id inside `PlayerModule`'s registry.
|
|
21
|
+
*/
|
|
22
|
+
@objc func attachPlayer(_ viewId: NSNumber, playerId: String) {
|
|
23
|
+
bridge.uiManager.addUIBlock { [weak self] _, views in
|
|
24
|
+
guard
|
|
25
|
+
let view = views?[viewId] as? RNPlayerView,
|
|
26
|
+
let player = self?.getPlayerModule()?.player(with: playerId)
|
|
27
|
+
else {
|
|
28
|
+
return
|
|
29
|
+
}
|
|
30
|
+
if let playerView = view.playerView {
|
|
31
|
+
playerView.player = player
|
|
32
|
+
} else {
|
|
33
|
+
view.playerView = PlayerView(player: player, frame: view.bounds)
|
|
34
|
+
}
|
|
35
|
+
player.add(listener: view)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
Remove `RNPlayerView` from its associated `Player` listeners list.
|
|
41
|
+
- Parameter viewId: `RNPlayerView` id inside `UIManager`'s registry.
|
|
42
|
+
- Parameter playerId: `Player` instance id inside `PlayerModule`'s registry.
|
|
43
|
+
*/
|
|
44
|
+
@objc func detachPlayer(_ viewId: NSNumber, playerId: String) {
|
|
45
|
+
bridge.uiManager.addUIBlock { [weak self] _, views in
|
|
46
|
+
guard
|
|
47
|
+
let view = views?[viewId] as? RNPlayerView,
|
|
48
|
+
let player = self?.getPlayerModule()?.player(with: playerId)
|
|
49
|
+
else {
|
|
50
|
+
return
|
|
51
|
+
}
|
|
52
|
+
player.remove(listener: view)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/// Fetches the initialized `PlayerModule` instance on RN's bridge object.
|
|
57
|
+
private func getPlayerModule() -> PlayerModule? {
|
|
58
|
+
bridge.module(for: PlayerModule.self) as? PlayerModule
|
|
59
|
+
}
|
|
60
|
+
}
|