@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,58 @@
|
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
const LINKING_ERROR =
|
|
4
|
+
`The package '@takeoffmedia/react-native-penthera' doesn't seem to be linked. Make sure: \n\n` +
|
|
5
|
+
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
6
|
+
'- You rebuilt the app after installing the package\n' +
|
|
7
|
+
'- You are not using Expo Go\n';
|
|
8
|
+
|
|
9
|
+
const Penthera = NativeModules.Penthera
|
|
10
|
+
? NativeModules.Penthera
|
|
11
|
+
: new Proxy(
|
|
12
|
+
{},
|
|
13
|
+
{
|
|
14
|
+
get() {
|
|
15
|
+
throw new Error(LINKING_ERROR);
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export function initialize(
|
|
21
|
+
user: string,
|
|
22
|
+
backplaneUrl: string,
|
|
23
|
+
publicKey: string,
|
|
24
|
+
privateKey: string
|
|
25
|
+
): Promise<string> {
|
|
26
|
+
return Penthera.initializeSdk(user, backplaneUrl, publicKey, privateKey);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function getDownloads(blank: string): Promise<string> {
|
|
30
|
+
return Penthera.getDownloads(blank);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function download(blank: string): Promise<string> {
|
|
34
|
+
return Penthera.download(blank);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function deleteAsset(assetID: string): Promise<string> {
|
|
38
|
+
return Penthera.delete(assetID);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function playAsset(assetID: string): Promise<string> {
|
|
42
|
+
return Penthera.playAsset(assetID);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function getByAssetId(assetID: string): Promise<string> {
|
|
46
|
+
return Penthera.getByAssetId(assetID);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function loadBitmovinSourceManager(
|
|
50
|
+
assetID: string,
|
|
51
|
+
nativeId: string
|
|
52
|
+
): Promise<boolean> {
|
|
53
|
+
return Penthera.loadBitmovinSourceManager(assetID, nativeId);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function multiply(a: number, b: number): Promise<number> {
|
|
57
|
+
return Penthera.multiply(a, b);
|
|
58
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export enum PentheraEvent {
|
|
2
|
+
VIRTUOSO_SUCCESS = 'Virtuoso Success',
|
|
3
|
+
DID_START_DOWNLOADING = 'DID_START_DOWNLOADING',
|
|
4
|
+
PROGRESS_UPDATED = 'PROGRESS_UPDATED',
|
|
5
|
+
DOWNLOAD_COMPLETE = 'DOWNLOAD_COMPLETE',
|
|
6
|
+
CONFIG_ASSET_FAILED = 'CONFIG_ASSET_FAILED',
|
|
7
|
+
ASSET_RESUME_DOWNLOAD_UPDATED = 'ASSET_RESUME_DOWNLOAD_UPDATED',
|
|
8
|
+
ASSET_DELETED = 'ASSET_DELETED',
|
|
9
|
+
ERROR_DOWNLOAD = 'ERROR_DOWNLOAD',
|
|
10
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
5
|
+
|
|
6
|
+
Pod::Spec.new do |s|
|
|
7
|
+
s.name = "takeoffmedia-react-native-penthera"
|
|
8
|
+
s.version = package["version"]
|
|
9
|
+
s.summary = package["description"]
|
|
10
|
+
s.homepage = package["homepage"]
|
|
11
|
+
s.license = package["license"]
|
|
12
|
+
s.authors = package["author"]
|
|
13
|
+
|
|
14
|
+
s.platforms = { :ios => "11.0" }
|
|
15
|
+
s.source = { :git => "https://github.com/take0ffmedia/react-native-penthera.git", :tag => "#{s.version}" }
|
|
16
|
+
|
|
17
|
+
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
|
+
|
|
19
|
+
s.dependency "React-Core"
|
|
20
|
+
s.dependency "VirtuosoClientDownloadEngine"
|
|
21
|
+
|
|
22
|
+
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
23
|
+
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
24
|
+
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
25
|
+
s.pod_target_xcconfig = {
|
|
26
|
+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
27
|
+
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
28
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
29
|
+
}
|
|
30
|
+
s.dependency "React-Codegen"
|
|
31
|
+
s.dependency "RCT-Folly"
|
|
32
|
+
s.dependency "RCTRequired"
|
|
33
|
+
s.dependency "RCTTypeSafety"
|
|
34
|
+
s.dependency "ReactCommon/turbomodule/core"
|
|
35
|
+
end
|
|
36
|
+
end
|