@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.
Files changed (96) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +203 -0
  3. package/android/build.gradle +105 -0
  4. package/android/gradle.properties +5 -0
  5. package/android/src/main/AndroidManifest.xml +51 -0
  6. package/android/src/main/java/com/takeoffmediareactnativepenthera/AssetQueueObserver.kt +148 -0
  7. package/android/src/main/java/com/takeoffmediareactnativepenthera/EventEmitter.kt +53 -0
  8. package/android/src/main/java/com/takeoffmediareactnativepenthera/PentheraModule.kt +104 -0
  9. package/android/src/main/java/com/takeoffmediareactnativepenthera/PentheraPackage.kt +16 -0
  10. package/android/src/main/java/com/takeoffmediareactnativepenthera/YourPlayerActivity.kt +14 -0
  11. package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/DemoLicenseManager.kt +50 -0
  12. package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/OfflineVideoEngine.kt +227 -0
  13. package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/PentheraContentProvider.kt +17 -0
  14. package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/ServiceStarter.kt +65 -0
  15. package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/data/Drm.kt +6 -0
  16. package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/data/Item.kt +34 -0
  17. package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/notification/NotificationFactory.kt +279 -0
  18. package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/notification/NotificationType.kt +10 -0
  19. package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/notification/ServiceForegroundNotificationProvider.kt +98 -0
  20. package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/util/Util.kt +22 -0
  21. package/android/src/main/res/drawable/ic_launcher_background.xml +170 -0
  22. package/android/src/main/res/drawable/small_logo.png +0 -0
  23. package/android/src/main/res/values/colors.xml +6 -0
  24. package/android/src/main/res/values/strings.xml +61 -0
  25. package/android/src/main/res/values/styles.xml +10 -0
  26. package/android/src/main/res/xml/network_security_config.xml +9 -0
  27. package/ios/Catalog.swift +30 -0
  28. package/ios/EventEmitter.swift +53 -0
  29. package/ios/Penthera-Bridging-Header.h +3 -0
  30. package/ios/Penthera.m +40 -0
  31. package/ios/Penthera.swift +384 -0
  32. package/ios/Penthera.xcodeproj/project.pbxproj +283 -0
  33. package/ios/Util.swift +16 -0
  34. package/ios/drm/FairPlayDrmSetup.swift +107 -0
  35. package/ios/drm/FairPlayLicenseProcessingDelegate.swift +42 -0
  36. package/lib/commonjs/data/data.json +58 -0
  37. package/lib/commonjs/hooks/index.js +13 -0
  38. package/lib/commonjs/hooks/index.js.map +1 -0
  39. package/lib/commonjs/hooks/usePenthera.js +146 -0
  40. package/lib/commonjs/hooks/usePenthera.js.map +1 -0
  41. package/lib/commonjs/index.js +36 -0
  42. package/lib/commonjs/index.js.map +1 -0
  43. package/lib/commonjs/interface/HomeTypes.js +6 -0
  44. package/lib/commonjs/interface/HomeTypes.js.map +1 -0
  45. package/lib/commonjs/interface/Idata.js +2 -0
  46. package/lib/commonjs/interface/Idata.js.map +1 -0
  47. package/lib/commonjs/interface/PentheraTypes.js +2 -0
  48. package/lib/commonjs/interface/PentheraTypes.js.map +1 -0
  49. package/lib/commonjs/nativeModules/index.js +48 -0
  50. package/lib/commonjs/nativeModules/index.js.map +1 -0
  51. package/lib/commonjs/utils/Penthera.js +19 -0
  52. package/lib/commonjs/utils/Penthera.js.map +1 -0
  53. package/lib/module/data/data.json +58 -0
  54. package/lib/module/hooks/index.js +2 -0
  55. package/lib/module/hooks/index.js.map +1 -0
  56. package/lib/module/hooks/usePenthera.js +139 -0
  57. package/lib/module/hooks/usePenthera.js.map +1 -0
  58. package/lib/module/index.js +5 -0
  59. package/lib/module/index.js.map +1 -0
  60. package/lib/module/interface/HomeTypes.js +2 -0
  61. package/lib/module/interface/HomeTypes.js.map +1 -0
  62. package/lib/module/interface/Idata.js +2 -0
  63. package/lib/module/interface/Idata.js.map +1 -0
  64. package/lib/module/interface/PentheraTypes.js +2 -0
  65. package/lib/module/interface/PentheraTypes.js.map +1 -0
  66. package/lib/module/nativeModules/index.js +35 -0
  67. package/lib/module/nativeModules/index.js.map +1 -0
  68. package/lib/module/utils/Penthera.js +12 -0
  69. package/lib/module/utils/Penthera.js.map +1 -0
  70. package/lib/typescript/hooks/index.d.ts +2 -0
  71. package/lib/typescript/hooks/index.d.ts.map +1 -0
  72. package/lib/typescript/hooks/usePenthera.d.ts +19 -0
  73. package/lib/typescript/hooks/usePenthera.d.ts.map +1 -0
  74. package/lib/typescript/index.d.ts +4 -0
  75. package/lib/typescript/index.d.ts.map +1 -0
  76. package/lib/typescript/interface/HomeTypes.d.ts +15 -0
  77. package/lib/typescript/interface/HomeTypes.d.ts.map +1 -0
  78. package/lib/typescript/interface/Idata.d.ts +30 -0
  79. package/lib/typescript/interface/Idata.d.ts.map +1 -0
  80. package/lib/typescript/interface/PentheraTypes.d.ts +104 -0
  81. package/lib/typescript/interface/PentheraTypes.d.ts.map +1 -0
  82. package/lib/typescript/nativeModules/index.d.ts +9 -0
  83. package/lib/typescript/nativeModules/index.d.ts.map +1 -0
  84. package/lib/typescript/utils/Penthera.d.ts +11 -0
  85. package/lib/typescript/utils/Penthera.d.ts.map +1 -0
  86. package/package.json +166 -0
  87. package/src/data/data.json +58 -0
  88. package/src/hooks/index.ts +1 -0
  89. package/src/hooks/usePenthera.ts +160 -0
  90. package/src/index.tsx +5 -0
  91. package/src/interface/HomeTypes.ts +16 -0
  92. package/src/interface/Idata.ts +34 -0
  93. package/src/interface/PentheraTypes.ts +104 -0
  94. package/src/nativeModules/index.ts +58 -0
  95. package/src/utils/Penthera.ts +10 -0
  96. 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