@takeoffmedia/react-native-penthera 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 +20 -0
- package/README.md +203 -0
- package/android/build.gradle +105 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +51 -0
- package/android/src/main/java/com/takeoffmediareactnativepenthera/AssetQueueObserver.kt +148 -0
- package/android/src/main/java/com/takeoffmediareactnativepenthera/EventEmitter.kt +53 -0
- package/android/src/main/java/com/takeoffmediareactnativepenthera/PentheraModule.kt +104 -0
- package/android/src/main/java/com/takeoffmediareactnativepenthera/PentheraPackage.kt +16 -0
- package/android/src/main/java/com/takeoffmediareactnativepenthera/YourPlayerActivity.kt +14 -0
- package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/DemoLicenseManager.kt +50 -0
- package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/OfflineVideoEngine.kt +227 -0
- package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/PentheraContentProvider.kt +17 -0
- package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/ServiceStarter.kt +65 -0
- package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/data/Drm.kt +6 -0
- package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/data/Item.kt +34 -0
- package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/notification/NotificationFactory.kt +279 -0
- package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/notification/NotificationType.kt +10 -0
- package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/notification/ServiceForegroundNotificationProvider.kt +98 -0
- package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/util/Util.kt +22 -0
- package/android/src/main/res/drawable/ic_launcher_background.xml +170 -0
- package/android/src/main/res/drawable/small_logo.png +0 -0
- package/android/src/main/res/values/colors.xml +6 -0
- package/android/src/main/res/values/strings.xml +61 -0
- package/android/src/main/res/values/styles.xml +10 -0
- package/android/src/main/res/xml/network_security_config.xml +9 -0
- package/ios/Catalog.swift +30 -0
- package/ios/EventEmitter.swift +53 -0
- package/ios/Penthera-Bridging-Header.h +3 -0
- package/ios/Penthera.m +40 -0
- package/ios/Penthera.swift +384 -0
- package/ios/Penthera.xcodeproj/project.pbxproj +283 -0
- package/ios/Util.swift +16 -0
- package/ios/drm/FairPlayDrmSetup.swift +107 -0
- package/ios/drm/FairPlayLicenseProcessingDelegate.swift +42 -0
- package/lib/commonjs/data/data.json +58 -0
- package/lib/commonjs/hooks/index.js +13 -0
- package/lib/commonjs/hooks/index.js.map +1 -0
- package/lib/commonjs/hooks/usePenthera.js +146 -0
- package/lib/commonjs/hooks/usePenthera.js.map +1 -0
- package/lib/commonjs/index.js +36 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/interface/HomeTypes.js +6 -0
- package/lib/commonjs/interface/HomeTypes.js.map +1 -0
- package/lib/commonjs/interface/Idata.js +2 -0
- package/lib/commonjs/interface/Idata.js.map +1 -0
- package/lib/commonjs/interface/PentheraTypes.js +2 -0
- package/lib/commonjs/interface/PentheraTypes.js.map +1 -0
- package/lib/commonjs/nativeModules/index.js +48 -0
- package/lib/commonjs/nativeModules/index.js.map +1 -0
- package/lib/commonjs/utils/Penthera.js +19 -0
- package/lib/commonjs/utils/Penthera.js.map +1 -0
- package/lib/module/data/data.json +58 -0
- package/lib/module/hooks/index.js +2 -0
- package/lib/module/hooks/index.js.map +1 -0
- package/lib/module/hooks/usePenthera.js +139 -0
- package/lib/module/hooks/usePenthera.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/interface/HomeTypes.js +2 -0
- package/lib/module/interface/HomeTypes.js.map +1 -0
- package/lib/module/interface/Idata.js +2 -0
- package/lib/module/interface/Idata.js.map +1 -0
- package/lib/module/interface/PentheraTypes.js +2 -0
- package/lib/module/interface/PentheraTypes.js.map +1 -0
- package/lib/module/nativeModules/index.js +35 -0
- package/lib/module/nativeModules/index.js.map +1 -0
- package/lib/module/utils/Penthera.js +12 -0
- package/lib/module/utils/Penthera.js.map +1 -0
- package/lib/typescript/hooks/index.d.ts +2 -0
- package/lib/typescript/hooks/index.d.ts.map +1 -0
- package/lib/typescript/hooks/usePenthera.d.ts +19 -0
- package/lib/typescript/hooks/usePenthera.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +4 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/interface/HomeTypes.d.ts +15 -0
- package/lib/typescript/interface/HomeTypes.d.ts.map +1 -0
- package/lib/typescript/interface/Idata.d.ts +30 -0
- package/lib/typescript/interface/Idata.d.ts.map +1 -0
- package/lib/typescript/interface/PentheraTypes.d.ts +104 -0
- package/lib/typescript/interface/PentheraTypes.d.ts.map +1 -0
- package/lib/typescript/nativeModules/index.d.ts +9 -0
- package/lib/typescript/nativeModules/index.d.ts.map +1 -0
- package/lib/typescript/utils/Penthera.d.ts +11 -0
- package/lib/typescript/utils/Penthera.d.ts.map +1 -0
- package/package.json +166 -0
- package/src/data/data.json +58 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/usePenthera.ts +160 -0
- package/src/index.tsx +5 -0
- package/src/interface/HomeTypes.ts +16 -0
- package/src/interface/Idata.ts +34 -0
- package/src/interface/PentheraTypes.ts +104 -0
- package/src/nativeModules/index.ts +58 -0
- package/src/utils/Penthera.ts +10 -0
- package/takeoffmedia-react-native-penthera.podspec +36 -0
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
// !$*UTF8*$!
|
|
2
|
+
{
|
|
3
|
+
archiveVersion = 1;
|
|
4
|
+
classes = {
|
|
5
|
+
};
|
|
6
|
+
objectVersion = 46;
|
|
7
|
+
objects = {
|
|
8
|
+
|
|
9
|
+
/* Begin PBXBuildFile section */
|
|
10
|
+
5E555C0D2413F4C50049A1A2 /* Penthera.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* Penthera.m */; };
|
|
11
|
+
F4FF95D7245B92E800C19C63 /* Penthera.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4FF95D6245B92E800C19C63 /* Penthera.swift */; };
|
|
12
|
+
/* End PBXBuildFile section */
|
|
13
|
+
|
|
14
|
+
/* Begin PBXCopyFilesBuildPhase section */
|
|
15
|
+
58B511D91A9E6C8500147676 /* CopyFiles */ = {
|
|
16
|
+
isa = PBXCopyFilesBuildPhase;
|
|
17
|
+
buildActionMask = 2147483647;
|
|
18
|
+
dstPath = "include/$(PRODUCT_NAME)";
|
|
19
|
+
dstSubfolderSpec = 16;
|
|
20
|
+
files = (
|
|
21
|
+
);
|
|
22
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
23
|
+
};
|
|
24
|
+
/* End PBXCopyFilesBuildPhase section */
|
|
25
|
+
|
|
26
|
+
/* Begin PBXFileReference section */
|
|
27
|
+
134814201AA4EA6300B7C361 /* libPenthera.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPenthera.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
28
|
+
B3E7B5891CC2AC0600A0062D /* Penthera.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Penthera.m; sourceTree = "<group>"; };
|
|
29
|
+
F4FF95D5245B92E700C19C63 /* Penthera-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Penthera-Bridging-Header.h"; sourceTree = "<group>"; };
|
|
30
|
+
F4FF95D6245B92E800C19C63 /* Penthera.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Penthera.swift; sourceTree = "<group>"; };
|
|
31
|
+
/* End PBXFileReference section */
|
|
32
|
+
|
|
33
|
+
/* Begin PBXFrameworksBuildPhase section */
|
|
34
|
+
58B511D81A9E6C8500147676 /* Frameworks */ = {
|
|
35
|
+
isa = PBXFrameworksBuildPhase;
|
|
36
|
+
buildActionMask = 2147483647;
|
|
37
|
+
files = (
|
|
38
|
+
);
|
|
39
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
40
|
+
};
|
|
41
|
+
/* End PBXFrameworksBuildPhase section */
|
|
42
|
+
|
|
43
|
+
/* Begin PBXGroup section */
|
|
44
|
+
134814211AA4EA7D00B7C361 /* Products */ = {
|
|
45
|
+
isa = PBXGroup;
|
|
46
|
+
children = (
|
|
47
|
+
134814201AA4EA6300B7C361 /* libPenthera.a */,
|
|
48
|
+
);
|
|
49
|
+
name = Products;
|
|
50
|
+
sourceTree = "<group>";
|
|
51
|
+
};
|
|
52
|
+
58B511D21A9E6C8500147676 = {
|
|
53
|
+
isa = PBXGroup;
|
|
54
|
+
children = (
|
|
55
|
+
F4FF95D6245B92E800C19C63 /* Penthera.swift */,
|
|
56
|
+
B3E7B5891CC2AC0600A0062D /* Penthera.m */,
|
|
57
|
+
F4FF95D5245B92E700C19C63 /* Penthera-Bridging-Header.h */,
|
|
58
|
+
134814211AA4EA7D00B7C361 /* Products */,
|
|
59
|
+
);
|
|
60
|
+
sourceTree = "<group>";
|
|
61
|
+
};
|
|
62
|
+
/* End PBXGroup section */
|
|
63
|
+
|
|
64
|
+
/* Begin PBXNativeTarget section */
|
|
65
|
+
58B511DA1A9E6C8500147676 /* Penthera */ = {
|
|
66
|
+
isa = PBXNativeTarget;
|
|
67
|
+
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "Penthera" */;
|
|
68
|
+
buildPhases = (
|
|
69
|
+
58B511D71A9E6C8500147676 /* Sources */,
|
|
70
|
+
58B511D81A9E6C8500147676 /* Frameworks */,
|
|
71
|
+
58B511D91A9E6C8500147676 /* CopyFiles */,
|
|
72
|
+
);
|
|
73
|
+
buildRules = (
|
|
74
|
+
);
|
|
75
|
+
dependencies = (
|
|
76
|
+
);
|
|
77
|
+
name = Penthera;
|
|
78
|
+
productName = RCTDataManager;
|
|
79
|
+
productReference = 134814201AA4EA6300B7C361 /* libPenthera.a */;
|
|
80
|
+
productType = "com.apple.product-type.library.static";
|
|
81
|
+
};
|
|
82
|
+
/* End PBXNativeTarget section */
|
|
83
|
+
|
|
84
|
+
/* Begin PBXProject section */
|
|
85
|
+
58B511D31A9E6C8500147676 /* Project object */ = {
|
|
86
|
+
isa = PBXProject;
|
|
87
|
+
attributes = {
|
|
88
|
+
LastUpgradeCheck = 0920;
|
|
89
|
+
ORGANIZATIONNAME = Facebook;
|
|
90
|
+
TargetAttributes = {
|
|
91
|
+
58B511DA1A9E6C8500147676 = {
|
|
92
|
+
CreatedOnToolsVersion = 6.1.1;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "Penthera" */;
|
|
97
|
+
compatibilityVersion = "Xcode 3.2";
|
|
98
|
+
developmentRegion = English;
|
|
99
|
+
hasScannedForEncodings = 0;
|
|
100
|
+
knownRegions = (
|
|
101
|
+
English,
|
|
102
|
+
en,
|
|
103
|
+
);
|
|
104
|
+
mainGroup = 58B511D21A9E6C8500147676;
|
|
105
|
+
productRefGroup = 58B511D21A9E6C8500147676;
|
|
106
|
+
projectDirPath = "";
|
|
107
|
+
projectRoot = "";
|
|
108
|
+
targets = (
|
|
109
|
+
58B511DA1A9E6C8500147676 /* Penthera */,
|
|
110
|
+
);
|
|
111
|
+
};
|
|
112
|
+
/* End PBXProject section */
|
|
113
|
+
|
|
114
|
+
/* Begin PBXSourcesBuildPhase section */
|
|
115
|
+
58B511D71A9E6C8500147676 /* Sources */ = {
|
|
116
|
+
isa = PBXSourcesBuildPhase;
|
|
117
|
+
buildActionMask = 2147483647;
|
|
118
|
+
files = (
|
|
119
|
+
F4FF95D7245B92E800C19C63 /* Penthera.swift in Sources */,
|
|
120
|
+
B3E7B58A1CC2AC0600A0062D /* Penthera.m in Sources */,
|
|
121
|
+
);
|
|
122
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
123
|
+
};
|
|
124
|
+
/* End PBXSourcesBuildPhase section */
|
|
125
|
+
|
|
126
|
+
/* Begin XCBuildConfiguration section */
|
|
127
|
+
58B511ED1A9E6C8500147676 /* Debug */ = {
|
|
128
|
+
isa = XCBuildConfiguration;
|
|
129
|
+
buildSettings = {
|
|
130
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
131
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
132
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
133
|
+
CLANG_ENABLE_MODULES = YES;
|
|
134
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
135
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
136
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
137
|
+
CLANG_WARN_COMMA = YES;
|
|
138
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
139
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
140
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
141
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
142
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
143
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
144
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
145
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
146
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
147
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
148
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
149
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
150
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
151
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
152
|
+
COPY_PHASE_STRIP = NO;
|
|
153
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
154
|
+
ENABLE_TESTABILITY = YES;
|
|
155
|
+
"EXCLUDED_ARCHS[sdk=*]" = arm64;
|
|
156
|
+
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
157
|
+
GCC_DYNAMIC_NO_PIC = NO;
|
|
158
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
|
159
|
+
GCC_OPTIMIZATION_LEVEL = 0;
|
|
160
|
+
GCC_PREPROCESSOR_DEFINITIONS = (
|
|
161
|
+
"DEBUG=1",
|
|
162
|
+
"$(inherited)",
|
|
163
|
+
);
|
|
164
|
+
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
|
165
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
166
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
167
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
168
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
169
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
170
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
171
|
+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
172
|
+
MTL_ENABLE_DEBUG_INFO = YES;
|
|
173
|
+
ONLY_ACTIVE_ARCH = YES;
|
|
174
|
+
SDKROOT = iphoneos;
|
|
175
|
+
};
|
|
176
|
+
name = Debug;
|
|
177
|
+
};
|
|
178
|
+
58B511EE1A9E6C8500147676 /* Release */ = {
|
|
179
|
+
isa = XCBuildConfiguration;
|
|
180
|
+
buildSettings = {
|
|
181
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
182
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
183
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
184
|
+
CLANG_ENABLE_MODULES = YES;
|
|
185
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
186
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
187
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
188
|
+
CLANG_WARN_COMMA = YES;
|
|
189
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
190
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
191
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
192
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
193
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
194
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
195
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
196
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
197
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
198
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
199
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
200
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
201
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
202
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
203
|
+
COPY_PHASE_STRIP = YES;
|
|
204
|
+
ENABLE_NS_ASSERTIONS = NO;
|
|
205
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
206
|
+
"EXCLUDED_ARCHS[sdk=*]" = arm64;
|
|
207
|
+
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
208
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
|
209
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
210
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
211
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
212
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
213
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
214
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
215
|
+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
216
|
+
MTL_ENABLE_DEBUG_INFO = NO;
|
|
217
|
+
SDKROOT = iphoneos;
|
|
218
|
+
VALIDATE_PRODUCT = YES;
|
|
219
|
+
};
|
|
220
|
+
name = Release;
|
|
221
|
+
};
|
|
222
|
+
58B511F01A9E6C8500147676 /* Debug */ = {
|
|
223
|
+
isa = XCBuildConfiguration;
|
|
224
|
+
buildSettings = {
|
|
225
|
+
HEADER_SEARCH_PATHS = (
|
|
226
|
+
"$(inherited)",
|
|
227
|
+
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
228
|
+
"$(SRCROOT)/../../../React/**",
|
|
229
|
+
"$(SRCROOT)/../../react-native/React/**",
|
|
230
|
+
);
|
|
231
|
+
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
232
|
+
OTHER_LDFLAGS = "-ObjC";
|
|
233
|
+
PRODUCT_NAME = Penthera;
|
|
234
|
+
SKIP_INSTALL = YES;
|
|
235
|
+
SWIFT_OBJC_BRIDGING_HEADER = "Penthera-Bridging-Header.h";
|
|
236
|
+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
|
237
|
+
SWIFT_VERSION = 5.0;
|
|
238
|
+
};
|
|
239
|
+
name = Debug;
|
|
240
|
+
};
|
|
241
|
+
58B511F11A9E6C8500147676 /* Release */ = {
|
|
242
|
+
isa = XCBuildConfiguration;
|
|
243
|
+
buildSettings = {
|
|
244
|
+
HEADER_SEARCH_PATHS = (
|
|
245
|
+
"$(inherited)",
|
|
246
|
+
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
247
|
+
"$(SRCROOT)/../../../React/**",
|
|
248
|
+
"$(SRCROOT)/../../react-native/React/**",
|
|
249
|
+
);
|
|
250
|
+
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
251
|
+
OTHER_LDFLAGS = "-ObjC";
|
|
252
|
+
PRODUCT_NAME = Penthera;
|
|
253
|
+
SKIP_INSTALL = YES;
|
|
254
|
+
SWIFT_OBJC_BRIDGING_HEADER = "Penthera-Bridging-Header.h";
|
|
255
|
+
SWIFT_VERSION = 5.0;
|
|
256
|
+
};
|
|
257
|
+
name = Release;
|
|
258
|
+
};
|
|
259
|
+
/* End XCBuildConfiguration section */
|
|
260
|
+
|
|
261
|
+
/* Begin XCConfigurationList section */
|
|
262
|
+
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "Penthera" */ = {
|
|
263
|
+
isa = XCConfigurationList;
|
|
264
|
+
buildConfigurations = (
|
|
265
|
+
58B511ED1A9E6C8500147676 /* Debug */,
|
|
266
|
+
58B511EE1A9E6C8500147676 /* Release */,
|
|
267
|
+
);
|
|
268
|
+
defaultConfigurationIsVisible = 0;
|
|
269
|
+
defaultConfigurationName = Release;
|
|
270
|
+
};
|
|
271
|
+
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "Penthera" */ = {
|
|
272
|
+
isa = XCConfigurationList;
|
|
273
|
+
buildConfigurations = (
|
|
274
|
+
58B511F01A9E6C8500147676 /* Debug */,
|
|
275
|
+
58B511F11A9E6C8500147676 /* Release */,
|
|
276
|
+
);
|
|
277
|
+
defaultConfigurationIsVisible = 0;
|
|
278
|
+
defaultConfigurationName = Release;
|
|
279
|
+
};
|
|
280
|
+
/* End XCConfigurationList section */
|
|
281
|
+
};
|
|
282
|
+
rootObject = 58B511D31A9E6C8500147676 /* Project object */;
|
|
283
|
+
}
|
package/ios/Util.swift
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
extension String {
|
|
5
|
+
func getDictionary() -> [String:AnyObject]? {
|
|
6
|
+
if let data = self.data(using: .utf8) {
|
|
7
|
+
do {
|
|
8
|
+
let json = try JSONSerialization.jsonObject(with: data, options: .mutableContainers) as? [String:AnyObject]
|
|
9
|
+
return json
|
|
10
|
+
} catch {
|
|
11
|
+
print("Something went wrong")
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return nil
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
//
|
|
2
|
+
// FairPlayDrmSetup.swift
|
|
3
|
+
// react-native-test
|
|
4
|
+
//
|
|
5
|
+
// Created by Oscar Gonzalez on 14/02/23.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import UIKit
|
|
9
|
+
import VirtuosoClientDownloadEngine
|
|
10
|
+
|
|
11
|
+
class FairPlayDrmSetup: NSObject {
|
|
12
|
+
|
|
13
|
+
// DRM SETUP REQUIRED
|
|
14
|
+
private var assetID: String!
|
|
15
|
+
private var customerAppCertificateUrl: String!
|
|
16
|
+
private var customerLicenceUrl: String!
|
|
17
|
+
private var customerLicenceHttpHeader: String!
|
|
18
|
+
private var customerToken: String!
|
|
19
|
+
|
|
20
|
+
init?(assetID: String, certificateUrl: String?, licenceUrl: String?, header: String?, token: String?) {
|
|
21
|
+
|
|
22
|
+
guard let _ = licenceUrl else { return nil }
|
|
23
|
+
guard let _ = certificateUrl else { return nil }
|
|
24
|
+
guard let _ = header else { return nil }
|
|
25
|
+
guard let _ = token else { return nil }
|
|
26
|
+
|
|
27
|
+
self.customerAppCertificateUrl = certificateUrl
|
|
28
|
+
self.customerLicenceUrl = licenceUrl
|
|
29
|
+
self.customerLicenceHttpHeader = header
|
|
30
|
+
self.customerToken = token
|
|
31
|
+
self.assetID = assetID
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Sample code showing how DRM might be configured.
|
|
35
|
+
func configure() ->Bool {
|
|
36
|
+
|
|
37
|
+
//
|
|
38
|
+
// Local function used to resolve license manager delegate
|
|
39
|
+
func createLicenseConfigurationDelegate() ->VirtuosoLicenseManagerDelegate? {
|
|
40
|
+
|
|
41
|
+
// Class VirtuosoLicenseDelegateHelper is provided as a helper for implementing
|
|
42
|
+
// delegate VirtuosoLicenseManagerDelegate. You are welcome to provide your own
|
|
43
|
+
// implentation of VirtuosoLicenseManagerDelegate and not use VirtuosoLicenseDelegateHelper
|
|
44
|
+
//
|
|
45
|
+
// VirtuosoLicenseDelegateHelper will automatically handle the delegate methods
|
|
46
|
+
// You need to provide VirtuosoLicenseConfiguration details and VirtuosoLicenseDelegateHelper
|
|
47
|
+
// will use that to implement the delegate callbacks.
|
|
48
|
+
//
|
|
49
|
+
// There are two options for how you setup VirtuosoLicenseDelegateHelper:
|
|
50
|
+
// 1) Provide one unique instance of VirtuosoLicenseConfiguration for each unique AssetID.
|
|
51
|
+
// 2) Proide one instance of VirtuosoLicenseConfiguration which is then used for all Assdets
|
|
52
|
+
//
|
|
53
|
+
// If you need to customize the parameters VirtuosoLicenseConfiguration for individual Assets,
|
|
54
|
+
// you can do that using the following:
|
|
55
|
+
// delegate.addLicense(<#T##config: VirtuosoLicenseConfiguration##VirtuosoLicenseConfiguration#>, forAssetID: <#T##String#>)
|
|
56
|
+
//
|
|
57
|
+
// If the parameters for VirtuosoLicenseConfiguration apply uniformly to all of your Assets,
|
|
58
|
+
// you can provide a single instance as follows:
|
|
59
|
+
// delegate.addLicense(<#T##config: VirtuosoLicenseConfiguration##VirtuosoLicenseConfiguration#>)
|
|
60
|
+
|
|
61
|
+
guard let vlc = VirtuosoLicenseConfiguration.init(suffix: nil, renewal: nil, parameters: [:], headers: [
|
|
62
|
+
"X-AxDRM-Message" : customerToken!,
|
|
63
|
+
"content-type" : "application/octet-stream"
|
|
64
|
+
]) else {
|
|
65
|
+
return nil
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
let delegate = VirtuosoLicenseDelegateHelper()
|
|
69
|
+
delegate.addLicense(vlc, forAssetID: assetID)
|
|
70
|
+
|
|
71
|
+
// One of the following calls is required for this code to work.
|
|
72
|
+
// delegate.addLicense(T##config: VirtuosoLicenseConfiguration##VirtuosoLicenseConfiguration)
|
|
73
|
+
// delegate.addLicense(<#T##config: VirtuosoLicenseConfiguration##VirtuosoLicenseConfiguration#>, forAssetID: <#T##String#>)
|
|
74
|
+
|
|
75
|
+
if (!delegate.isConfigured()) {
|
|
76
|
+
// IMPORTANT
|
|
77
|
+
// Code will fail here until you uncomment one of the above lines and initialize by adding a license.
|
|
78
|
+
print("Code will fail here until you uncomment one of the above lines and initialize by adding a license.")
|
|
79
|
+
return nil
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return delegate
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
print("******************+")
|
|
86
|
+
print(self.customerAppCertificateUrl!)
|
|
87
|
+
|
|
88
|
+
print("******************+")
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
VirtuosoLicenseManager.downloadClientAppCertificate(fromURL: self.customerAppCertificateUrl, for: .vlm_FairPlay)
|
|
92
|
+
VirtuosoLicenseManager.setLicenseServerURL(self.customerLicenceUrl, for: .vlm_FairPlay)
|
|
93
|
+
|
|
94
|
+
guard let delegate = createLicenseConfigurationDelegate() else {
|
|
95
|
+
print("failed to initialize VirtuosoLicenseManager delegate")
|
|
96
|
+
return false
|
|
97
|
+
}
|
|
98
|
+
print("delegate --> \(delegate)")
|
|
99
|
+
VirtuosoLicenseManager.setDelegate(delegate)
|
|
100
|
+
VirtuosoLicenseManager.setLicenseProcessingDelegate(FairPlayLicenseProcessingDelegate())
|
|
101
|
+
|
|
102
|
+
//let contentKeySession = VirtuosoLicenseManager.registeredAVContentKeySession()
|
|
103
|
+
|
|
104
|
+
return true
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
//
|
|
2
|
+
// FairPlayLicenseProcessingDelegate.swift
|
|
3
|
+
// react-native-test
|
|
4
|
+
//
|
|
5
|
+
// Created by Oscar Gonzalez on 7/02/23.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import UIKit
|
|
9
|
+
import VirtuosoClientDownloadEngine
|
|
10
|
+
|
|
11
|
+
class FairPlayLicenseProcessingDelegate: NSObject, VirtuosoLicenseProcessingDelegate {
|
|
12
|
+
|
|
13
|
+
func extractCID(for asset: VirtuosoAsset, fromFairPlayRequest fpRequest: URL) -> String? {
|
|
14
|
+
// IMPORTANT:
|
|
15
|
+
// Custom code may be required to support this on your DRM implmentation
|
|
16
|
+
print("CID Custom code may be required to support this on your DRM implmentation.")
|
|
17
|
+
//EventEmitter.sharedInstance.dispatch(name: "penthera", code: PentheraEvent.FAIR_PLAY_EXTRACT_CID, assetId: asset.assetID, body: fpRequest.absoluteURL.absoluteString)
|
|
18
|
+
let cid = fpRequest.absoluteString.components(separatedBy: "/").last ?? fpRequest.absoluteString
|
|
19
|
+
return cid.replacingOccurrences(of: "?", with: "")
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
func prepareSPC(for asset: VirtuosoAsset, inLicenseRequest spc: Data) -> Data? {
|
|
23
|
+
// IMPORTANT:
|
|
24
|
+
// Custom code may be required to support this on your DRM implmentation
|
|
25
|
+
print("SPC Custom code may be required to support this on your DRM implmentation.")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
//EventEmitter.sharedInstance.dispatch(name: "penthera", code: PentheraEvent.FAIR_PLAY_PREPARE_SPC, assetId: asset.assetID, body: spc.base64EncodedString())
|
|
29
|
+
return spc
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
func extractCKC(for asset: VirtuosoAsset, inLicenseResponse response: Data) -> Data? {
|
|
33
|
+
// IMPORTANT:
|
|
34
|
+
// Custom code may be required to support this on your DRM implmentation
|
|
35
|
+
print("CKC Custom code may be required to support this on your DRM implmentation.")
|
|
36
|
+
print(response.base64EncodedString())
|
|
37
|
+
//EventEmitter.sharedInstance.dispatch(name: "penthera", code: PentheraEvent.FAIR_PLAY_EXTRACT_CKC, assetId: asset.assetID, body: response.base64EncodedString())
|
|
38
|
+
return response
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "43055",
|
|
4
|
+
"title": "The Responder S1 E1",
|
|
5
|
+
"path": "/episode/The_Responder_S1_E1_p0b61zcv",
|
|
6
|
+
"drm": false,
|
|
7
|
+
"thumbnail": "https://stag-static.bbc-massive.com/shain/v1/dataservice/ResizeImage/$value?Format=%27jpg%27&Quality=85&Width=250&Height=350&ImageUrl=271870.jpg",
|
|
8
|
+
"thumbnails": {
|
|
9
|
+
"season": "https://stag-static.bbc-massive.com/shain/v1/dataservice/ResizeImage/$value?Format=%27jpg%27&Quality=85&Width=1248&Height=702&ImageUrl=271858.jpg",
|
|
10
|
+
"show": "https://stag-static.bbc-massive.com/shain/v1/dataservice/ResizeImage/$value?Format=%27jpg%27&Quality=85&Width=250&Height=350&ImageUrl=271870.jpg",
|
|
11
|
+
"episode": "https://stag-static.bbc-massive.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=85&Width=1248&Height=702&ImageUrl=271881.jpg"
|
|
12
|
+
},
|
|
13
|
+
"subtitles": {
|
|
14
|
+
"es": "https://bitdash-a.akamaihd.net/content/sintel/subtitles/subtitles_en.vtt",
|
|
15
|
+
"en": "https://bitdash-a.akamaihd.net/content/sintel/subtitles/subtitles_en.vtt"
|
|
16
|
+
},
|
|
17
|
+
"data": {
|
|
18
|
+
"title": "The Responder S1 E1",
|
|
19
|
+
"description": "Police responder Chris nears breaking point as a friend asks him to locate a drug addict.",
|
|
20
|
+
"releaseYear": 2022,
|
|
21
|
+
"showId": "32692",
|
|
22
|
+
"showTitle": "The Responder",
|
|
23
|
+
"seasonId": "32692",
|
|
24
|
+
"seasonTitle": "Season 1",
|
|
25
|
+
"genres": [
|
|
26
|
+
"Drama"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"id": "11750",
|
|
32
|
+
"title": "A Touch of Frost S1 E1",
|
|
33
|
+
"path": "/episode/A_Touch_of_Frost_S1_E1_p04lq5sl",
|
|
34
|
+
"drm": false,
|
|
35
|
+
"thumbnail": "https://stag-static.bbc-massive.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=85&Width=250&Height=350&ImageUrl=252250.jpg"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"id": "24266",
|
|
39
|
+
"title": "Death in Paradise S1 E1",
|
|
40
|
+
"path": "/episode/Death_in_Paradise_S1_E1_b016mw99",
|
|
41
|
+
"drm": false,
|
|
42
|
+
"thumbnail": "https://stag-static.bbc-massive.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=85&Width=250&Height=350&ImageUrl=213434.jpg"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "18569",
|
|
46
|
+
"title": "Our Girl S1 E1",
|
|
47
|
+
"path": "/episode/Our_Girl_S1_E1_p069dphk",
|
|
48
|
+
"drm": true,
|
|
49
|
+
"thumbnail": "https://stag-static.bbc-massive.com/shain/v1/dataservice/ResizeImage/$value?Format=%27png%27&Quality=85&Width=250&Height=350&ImageUrl=242191.png"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"id": "23207",
|
|
53
|
+
"title": "The Victim S1 E1",
|
|
54
|
+
"path": "/episode/The_Victim_S1_E1_m00041yn",
|
|
55
|
+
"drm": true,
|
|
56
|
+
"thumbnail": "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=85&Width=250&Height=350&ImageUrl=205919.jpg"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "usePenthera", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _usePenthera.usePenthera;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _usePenthera = require("./usePenthera");
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_usePenthera","require"],"sourceRoot":"../../../src","sources":["hooks/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.usePenthera = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _reactNativeConfig = _interopRequireDefault(require("react-native-config"));
|
|
10
|
+
var _reactNativePenthera = require("@takeoffmedia/react-native-penthera");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
const usePenthera = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
data,
|
|
15
|
+
sessionConnect
|
|
16
|
+
} = _ref;
|
|
17
|
+
const [catalog, setCatalogResult] = (0, _react.useState)(data);
|
|
18
|
+
(0, _react.useEffect)(() => {
|
|
19
|
+
initializePenthera();
|
|
20
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
21
|
+
}, []);
|
|
22
|
+
(0, _react.useEffect)(() => {
|
|
23
|
+
const eventListener = listenerPethera();
|
|
24
|
+
return () => {
|
|
25
|
+
eventListener.remove();
|
|
26
|
+
};
|
|
27
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28
|
+
}, []);
|
|
29
|
+
|
|
30
|
+
// Start Penthera SDK
|
|
31
|
+
const initializePenthera = async () => {
|
|
32
|
+
try {
|
|
33
|
+
const response = await (0, _reactNativePenthera.initialize)('123456789329329329392392', _reactNativeConfig.default.BACKPLANE_URL, _reactNativeConfig.default.BACKPLANE_PUBLIC_KEY, _reactNativeConfig.default.BACKPLANE_PRIVATE_KEY);
|
|
34
|
+
console.log('Penthera initialization successfully', response);
|
|
35
|
+
getAllDownloads();
|
|
36
|
+
} catch (error) {
|
|
37
|
+
console.error('Error: initializePenthera>>', error);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// Config Event Listener
|
|
42
|
+
const listenerPethera = () => {
|
|
43
|
+
const NEventEmitter = _reactNative.NativeModules.Penthera;
|
|
44
|
+
const eventEmitter = new _reactNative.NativeEventEmitter(NEventEmitter);
|
|
45
|
+
const eventListener = eventEmitter.addListener('penthera', sessionConnect);
|
|
46
|
+
return eventListener;
|
|
47
|
+
};
|
|
48
|
+
const downloadVideo = async _ref2 => {
|
|
49
|
+
let {
|
|
50
|
+
item,
|
|
51
|
+
drm,
|
|
52
|
+
url
|
|
53
|
+
} = _ref2;
|
|
54
|
+
const dataBySO = _reactNative.Platform.OS === 'android' ? {
|
|
55
|
+
asset_id: item.id,
|
|
56
|
+
content_url: url,
|
|
57
|
+
poster: item.thumbnail,
|
|
58
|
+
subtitle: '',
|
|
59
|
+
...item
|
|
60
|
+
} : {
|
|
61
|
+
item,
|
|
62
|
+
url,
|
|
63
|
+
drm
|
|
64
|
+
};
|
|
65
|
+
try {
|
|
66
|
+
await (0, _reactNativePenthera.download)(JSON.stringify(dataBySO));
|
|
67
|
+
} catch (error) {
|
|
68
|
+
console.error('error: downloadAsset', error);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const playVideo = async assetId => {
|
|
72
|
+
try {
|
|
73
|
+
const response = await (0, _reactNativePenthera.playAsset)(assetId);
|
|
74
|
+
return JSON.parse(response);
|
|
75
|
+
} catch (error) {
|
|
76
|
+
console.error('Error in reproduceVideo>>>', error);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const handleDeleteAsset = async assetId => {
|
|
80
|
+
try {
|
|
81
|
+
await (0, _reactNativePenthera.deleteAsset)(assetId);
|
|
82
|
+
deletedAsset({
|
|
83
|
+
assetId
|
|
84
|
+
});
|
|
85
|
+
} catch (error) {
|
|
86
|
+
console.error('Error: handleDeleteAsset', error);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const getAllDownloads = async () => {
|
|
90
|
+
try {
|
|
91
|
+
const response = await (0, _reactNativePenthera.getDownloads)('');
|
|
92
|
+
const dataResponse = JSON.parse(response);
|
|
93
|
+
dataResponse.forEach(item => {
|
|
94
|
+
const newCatalog = [...catalog];
|
|
95
|
+
let index = newCatalog.findIndex(i => i.id === item.id);
|
|
96
|
+
if (index >= 0) {
|
|
97
|
+
if (item.isCompleted) {
|
|
98
|
+
newCatalog[index].download_percentage = 100;
|
|
99
|
+
}
|
|
100
|
+
newCatalog[index].isCompleted = item.isCompleted;
|
|
101
|
+
newCatalog[index].isPaused = item.isPaused;
|
|
102
|
+
setCatalogResult(newCatalog);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
} catch (error) {
|
|
106
|
+
console.error('Error: getAllDownloads', error);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
const deletedAsset = _ref3 => {
|
|
110
|
+
let {
|
|
111
|
+
assetId
|
|
112
|
+
} = _ref3;
|
|
113
|
+
const newCatalog = [...catalog];
|
|
114
|
+
let index = newCatalog.findIndex(i => i.id === assetId);
|
|
115
|
+
if (index >= 0) {
|
|
116
|
+
newCatalog[index].download_percentage = 0;
|
|
117
|
+
newCatalog[index].isCompleted = false;
|
|
118
|
+
newCatalog[index].isPaused = false;
|
|
119
|
+
setCatalogResult(newCatalog);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
const updateDownload = _ref4 => {
|
|
123
|
+
let {
|
|
124
|
+
assetID,
|
|
125
|
+
percentage
|
|
126
|
+
} = _ref4;
|
|
127
|
+
const newCatalog = [...catalog];
|
|
128
|
+
let index = newCatalog.findIndex(i => i.id === assetID);
|
|
129
|
+
if (index >= 0) {
|
|
130
|
+
newCatalog[index].download_percentage = percentage;
|
|
131
|
+
setCatalogResult(newCatalog);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
return {
|
|
135
|
+
catalog,
|
|
136
|
+
setCatalogResult,
|
|
137
|
+
playVideo,
|
|
138
|
+
handleDeleteAsset,
|
|
139
|
+
downloadVideo,
|
|
140
|
+
getAllDownloads,
|
|
141
|
+
updateDownload,
|
|
142
|
+
deletedAsset
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
exports.usePenthera = usePenthera;
|
|
146
|
+
//# sourceMappingURL=usePenthera.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_reactNativeConfig","_interopRequireDefault","_reactNativePenthera","obj","__esModule","default","usePenthera","_ref","data","sessionConnect","catalog","setCatalogResult","useState","useEffect","initializePenthera","eventListener","listenerPethera","remove","response","initialize","Config","BACKPLANE_URL","BACKPLANE_PUBLIC_KEY","BACKPLANE_PRIVATE_KEY","console","log","getAllDownloads","error","NEventEmitter","NativeModules","Penthera","eventEmitter","NativeEventEmitter","addListener","downloadVideo","_ref2","item","drm","url","dataBySO","Platform","OS","asset_id","id","content_url","poster","thumbnail","subtitle","download","JSON","stringify","playVideo","assetId","playAsset","parse","handleDeleteAsset","deleteAsset","deletedAsset","getDownloads","dataResponse","forEach","newCatalog","index","findIndex","i","isCompleted","download_percentage","isPaused","_ref3","updateDownload","_ref4","assetID","percentage","exports"],"sourceRoot":"../../../src","sources":["hooks/usePenthera.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAKA,IAAAE,kBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AAM6C,SAAAG,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAUtC,MAAMG,WAAW,GAAGC,IAAA,IAA4C;EAAA,IAA3C;IAAEC,IAA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