@takeoffmedia/react-native-penthera 0.2.61 → 0.2.63

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.
@@ -42,6 +42,10 @@ class OfflineVideoEngine(private val context: ReactApplicationContext) {
42
42
  var assetId: MutableList<String> = mutableListOf()
43
43
  private val gson = Gson()
44
44
  var minimumLowBandWidth: Double = 0.00010
45
+ var valueUserId: String = ""
46
+ var valueBackPlaneUrl: String = ""
47
+ var valuePublicKey: String = ""
48
+ var valuePrivateKey: String = ""
45
49
 
46
50
  private val enginePauseObserver: Observers.IEngineObserver = object : EngineObserver() {
47
51
  override fun engineStatusChanged(status: Int) {
@@ -69,22 +73,26 @@ class OfflineVideoEngine(private val context: ReactApplicationContext) {
69
73
  }
70
74
 
71
75
  fun setup(
72
- userId: String,
73
- backplaneUrl: String,
74
- publicKey: String,
75
- privateKey: String,
76
- promise: Promise,
76
+ userId: String = valueUserId,
77
+ backplaneUrl: String = valueBackPlaneUrl,
78
+ publicKey: String = valuePublicKey,
79
+ privateKey: String = valuePrivateKey,
80
+ promise: Promise? = null
77
81
  ) {
78
82
  val vir = getInstanceVirtuoso()
83
+ valueUserId = userId
84
+ valueBackPlaneUrl = backplaneUrl
85
+ valuePrivateKey = privateKey
86
+ valuePublicKey = publicKey
79
87
 
80
88
  val nameDevice = android.os.Build.MODEL
81
89
 
82
90
  vir.startup(
83
- URL(backplaneUrl),
84
- userId,
85
- nameDevice,
86
- publicKey,
87
- privateKey,
91
+ URL(valueBackPlaneUrl),
92
+ valueUserId,
93
+ nameDevice,
94
+ valuePublicKey,
95
+ valuePrivateKey,
88
96
  object : IPushRegistrationObserver {
89
97
  override fun onServiceAvailabilityResponse(
90
98
  pushService: Int,
@@ -94,12 +102,13 @@ class OfflineVideoEngine(private val context: ReactApplicationContext) {
94
102
  }
95
103
  }
96
104
  ).let {
97
- promise.resolve("Penthera initialization successfully")
105
+ promise?.resolve("Penthera initialization successfully")
98
106
  }
99
107
 
100
108
  }
101
109
 
102
110
  fun downloadAsset(newItem: String) {
111
+ setup()
103
112
  val data = JSONObject(newItem)
104
113
  val item = data["item"] as JSONObject
105
114
  assetId.add(item["id"].toString())
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takeoffmedia/react-native-penthera",
3
- "version": "0.2.61",
3
+ "version": "0.2.63",
4
4
  "description": "test",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -166,4 +166,4 @@
166
166
  "dependencies": {
167
167
  "zustand": "^4.4.0"
168
168
  }
169
- }
169
+ }