react-native-tpstreams 1.0.3 → 1.0.5-dev.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/README.md +94 -542
- package/TPStreamsRNPlayerView.podspec +1 -1
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/TPStreamsRNPlayerViewManagerDelegate.java +87 -0
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/TPStreamsRNPlayerViewManagerInterface.java +34 -0
- package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +36 -0
- package/android/app/build/generated/source/codegen/jni/TPStreamsPlayerViewSpec-generated.cpp +22 -0
- package/android/app/build/generated/source/codegen/jni/TPStreamsPlayerViewSpec.h +24 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/ComponentDescriptors.cpp +22 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/ComponentDescriptors.h +24 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/EventEmitters.cpp +107 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/EventEmitters.h +81 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/Props.cpp +32 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/Props.h +34 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/ShadowNodes.cpp +17 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/ShadowNodes.h +32 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/States.cpp +16 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/States.h +29 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/TPStreamsPlayerViewSpecJSI-generated.cpp +17 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/TPStreamsPlayerViewSpecJSI.h +19 -0
- package/android/src/main/java/com/tpstreams/JsonUtils.kt +46 -0
- package/android/src/main/java/com/tpstreams/TPStreamsDownloadModule.kt +2 -7
- package/android/src/main/java/com/tpstreams/TPStreamsRNPlayerView.kt +3 -3
- package/ios/TPStreamsDownloadModule.swift +8 -3
- package/ios/TPStreamsModule.swift +1 -2
- package/ios/TPStreamsRNPlayerView.swift +77 -2
- package/lib/typescript/src/TPStreamsDownload.d.ts +1 -1
- package/lib/typescript/src/TPStreamsDownload.d.ts.map +1 -1
- package/lib/typescript/src/TPStreamsPlayer.d.ts +1 -1
- package/lib/typescript/src/TPStreamsPlayer.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/TPStreamsDownload.tsx +1 -1
- package/src/TPStreamsPlayer.tsx +1 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
package com.tpstreams
|
|
2
|
+
|
|
3
|
+
import org.json.JSONObject
|
|
4
|
+
|
|
5
|
+
object JsonUtils {
|
|
6
|
+
|
|
7
|
+
fun parseJsonString(map: Map<String, Any>?): Map<String, Any> {
|
|
8
|
+
val result = mutableMapOf<String, Any>()
|
|
9
|
+
map?.forEach { (key, value) ->
|
|
10
|
+
when (value) {
|
|
11
|
+
is String -> {
|
|
12
|
+
if (value.startsWith("{") && value.endsWith("}")) {
|
|
13
|
+
try {
|
|
14
|
+
val json = JSONObject(value)
|
|
15
|
+
result[key] = jsonToMap(json)
|
|
16
|
+
} catch (e: Exception) {
|
|
17
|
+
result[key] = value
|
|
18
|
+
}
|
|
19
|
+
} else {
|
|
20
|
+
result[key] = value
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else -> result[key] = value
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return result
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
private fun jsonToMap(json: JSONObject): Map<String, Any> {
|
|
30
|
+
val map = mutableMapOf<String, Any>()
|
|
31
|
+
val keys = json.keys()
|
|
32
|
+
while (keys.hasNext()) {
|
|
33
|
+
val key = keys.next()
|
|
34
|
+
val value = json.get(key)
|
|
35
|
+
when (value) {
|
|
36
|
+
is String -> map[key] = value
|
|
37
|
+
is Int -> map[key] = value
|
|
38
|
+
is Double -> map[key] = value
|
|
39
|
+
is Boolean -> map[key] = value
|
|
40
|
+
is JSONObject -> map[key] = jsonToMap(value)
|
|
41
|
+
else -> map[key] = value.toString()
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return map
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -109,13 +109,8 @@ class TPStreamsDownloadModule(private val reactContext: ReactApplicationContext)
|
|
|
109
109
|
map.putDouble("downloadedBytes", item.downloadedBytes.toDouble())
|
|
110
110
|
map.putDouble("progressPercentage", item.progressPercentage.toDouble())
|
|
111
111
|
map.putString("state", downloadClient.getDownloadStatus(item.assetId))
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
item.metadata.forEach { (key, value) ->
|
|
115
|
-
metadataJson.put(key, value)
|
|
116
|
-
}
|
|
117
|
-
map.putString("metadata", metadataJson.toString())
|
|
118
|
-
|
|
112
|
+
val parsedMetadata = JsonUtils.parseJsonString(item.metadata)
|
|
113
|
+
map.putMap("metadata", Arguments.makeNativeMap(parsedMetadata))
|
|
119
114
|
return map
|
|
120
115
|
}
|
|
121
116
|
|
|
@@ -30,7 +30,7 @@ class TPStreamsRNPlayerView(context: ThemedReactContext) : FrameLayout(context)
|
|
|
30
30
|
private var startAt: Long = 0
|
|
31
31
|
private var showDefaultCaptions: Boolean = false
|
|
32
32
|
private var enableDownload: Boolean = false
|
|
33
|
-
private var downloadMetadata: Map<String,
|
|
33
|
+
private var downloadMetadata: Map<String, Any>? = null
|
|
34
34
|
private var offlineLicenseExpireTime: Long = DEFAULT_OFFLINE_LICENSE_EXPIRE_TIME
|
|
35
35
|
private var accessTokenCallback: ((String) -> Unit)? = null
|
|
36
36
|
|
|
@@ -87,7 +87,7 @@ class TPStreamsRNPlayerView(context: ThemedReactContext) : FrameLayout(context)
|
|
|
87
87
|
this.enableDownload = enableDownload
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
fun setDownloadMetadata(metadata: Map<String,
|
|
90
|
+
fun setDownloadMetadata(metadata: Map<String, Any>?) {
|
|
91
91
|
this.downloadMetadata = metadata
|
|
92
92
|
}
|
|
93
93
|
|
|
@@ -116,7 +116,7 @@ class TPStreamsRNPlayerView(context: ThemedReactContext) : FrameLayout(context)
|
|
|
116
116
|
startAt,
|
|
117
117
|
enableDownload,
|
|
118
118
|
showDefaultCaptions,
|
|
119
|
-
downloadMetadata,
|
|
119
|
+
downloadMetadata?.mapValues { it.value.toString() },
|
|
120
120
|
offlineLicenseExpireTime
|
|
121
121
|
)
|
|
122
122
|
|
|
@@ -23,12 +23,16 @@ class TPStreamsDownloadModule: RCTEventEmitter, TPStreamsDownloadDelegate {
|
|
|
23
23
|
private let downloadManager = TPStreamsDownloadManager.shared
|
|
24
24
|
private var isListening = false
|
|
25
25
|
private var tokenDelegate: TokenRequestDelegate?
|
|
26
|
-
static var
|
|
27
|
-
|
|
26
|
+
private static var _shared: TPStreamsDownloadModule?
|
|
27
|
+
|
|
28
|
+
static var shared: TPStreamsDownloadModule? {
|
|
29
|
+
return _shared
|
|
30
|
+
}
|
|
31
|
+
|
|
28
32
|
override init() {
|
|
29
33
|
super.init()
|
|
34
|
+
TPStreamsDownloadModule._shared = self
|
|
30
35
|
downloadManager.setTPStreamsDownloadDelegate(tpStreamsDownloadDelegate: self)
|
|
31
|
-
TPStreamsDownloadModule.shared = self
|
|
32
36
|
}
|
|
33
37
|
|
|
34
38
|
func setAccessTokenDelegate(_ delegate: TokenRequestDelegate) {
|
|
@@ -43,6 +47,7 @@ class TPStreamsDownloadModule: RCTEventEmitter, TPStreamsDownloadDelegate {
|
|
|
43
47
|
@objc
|
|
44
48
|
func addDownloadProgressListener(_ resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
45
49
|
isListening = true
|
|
50
|
+
notifyDownloadsChange()
|
|
46
51
|
resolve(nil)
|
|
47
52
|
}
|
|
48
53
|
|
|
@@ -9,7 +9,6 @@ class TPStreamsModule: NSObject {
|
|
|
9
9
|
|
|
10
10
|
@objc func initialize(_ organizationId: NSString) {
|
|
11
11
|
if !isInitialized {
|
|
12
|
-
print("Initializing TPStreamsSDK with org code: \(organizationId)")
|
|
13
12
|
DispatchQueue.main.async {
|
|
14
13
|
TPStreamsSDK.initialize(withOrgCode: organizationId as String)
|
|
15
14
|
self.isInitialized = true
|
|
@@ -19,7 +18,7 @@ class TPStreamsModule: NSObject {
|
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
private func initializeDownloadModule() {
|
|
22
|
-
|
|
21
|
+
_ = TPStreamsDownloadModule.shared
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
@objc
|
|
@@ -7,9 +7,19 @@ import AVFoundation
|
|
|
7
7
|
@objc(TPStreamsRNPlayerView)
|
|
8
8
|
class TPStreamsRNPlayerView: UIView {
|
|
9
9
|
|
|
10
|
+
private enum PlaybackState: Int {
|
|
11
|
+
case idle = 1
|
|
12
|
+
case buffering = 2
|
|
13
|
+
case ready = 3
|
|
14
|
+
case ended = 4
|
|
15
|
+
}
|
|
16
|
+
|
|
10
17
|
private var player: TPAVPlayer?
|
|
11
18
|
private var playerViewController: TPStreamPlayerViewController?
|
|
12
19
|
private var playerStatusObserver: NSKeyValueObservation?
|
|
20
|
+
private var playbackSpeedObserver: NSKeyValueObservation?
|
|
21
|
+
private var timeControlStatusObserver: NSKeyValueObservation?
|
|
22
|
+
private var playerStateObserver: NSKeyValueObservation?
|
|
13
23
|
private var setupScheduled = false
|
|
14
24
|
|
|
15
25
|
@objc var videoId: NSString = ""
|
|
@@ -25,6 +35,7 @@ class TPStreamsRNPlayerView: UIView {
|
|
|
25
35
|
@objc var onDuration: RCTDirectEventBlock?
|
|
26
36
|
@objc var onIsPlaying: RCTDirectEventBlock?
|
|
27
37
|
@objc var onPlaybackSpeed: RCTDirectEventBlock?
|
|
38
|
+
|
|
28
39
|
@objc var onPlayerStateChanged: RCTDirectEventBlock?
|
|
29
40
|
@objc var onIsPlayingChanged: RCTDirectEventBlock?
|
|
30
41
|
@objc var onPlaybackSpeedChanged: RCTDirectEventBlock?
|
|
@@ -96,6 +107,12 @@ class TPStreamsRNPlayerView: UIView {
|
|
|
96
107
|
private func removeObservers() {
|
|
97
108
|
playerStatusObserver?.invalidate()
|
|
98
109
|
playerStatusObserver = nil
|
|
110
|
+
playbackSpeedObserver?.invalidate()
|
|
111
|
+
playbackSpeedObserver = nil
|
|
112
|
+
timeControlStatusObserver?.invalidate()
|
|
113
|
+
timeControlStatusObserver = nil
|
|
114
|
+
playerStateObserver?.invalidate()
|
|
115
|
+
playerStateObserver = nil
|
|
99
116
|
}
|
|
100
117
|
|
|
101
118
|
private func createOfflinePlayer() -> TPAVPlayer? {
|
|
@@ -167,6 +184,9 @@ class TPStreamsRNPlayerView: UIView {
|
|
|
167
184
|
|
|
168
185
|
private func observePlayerChanges() {
|
|
169
186
|
setupSeekObserver()
|
|
187
|
+
setupPlayerStateObserver()
|
|
188
|
+
setupPlaybackSpeedObserver()
|
|
189
|
+
setupPlayingStateObserver()
|
|
170
190
|
}
|
|
171
191
|
|
|
172
192
|
private func setupSeekObserver() {
|
|
@@ -180,16 +200,71 @@ class TPStreamsRNPlayerView: UIView {
|
|
|
180
200
|
}
|
|
181
201
|
}
|
|
182
202
|
|
|
203
|
+
private func setupPlaybackSpeedObserver() {
|
|
204
|
+
guard let player = player else { return }
|
|
205
|
+
|
|
206
|
+
playbackSpeedObserver = player.observe(\.rate, options: [.new]) { [weak self] player, _ in
|
|
207
|
+
DispatchQueue.main.async {
|
|
208
|
+
self?.onPlaybackSpeedChanged?(["speed": player.rate])
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
private func setupPlayingStateObserver() {
|
|
214
|
+
guard let player = player else { return }
|
|
215
|
+
|
|
216
|
+
timeControlStatusObserver = player.observe(\.timeControlStatus, options: [.new, .initial]) { [weak self] player, _ in
|
|
217
|
+
DispatchQueue.main.async {
|
|
218
|
+
let isPlaying = player.timeControlStatus == .playing
|
|
219
|
+
self?.onIsPlayingChanged?(["isPlaying": isPlaying])
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
private func setupPlayerStateObserver() {
|
|
225
|
+
guard let player = player else { return }
|
|
226
|
+
|
|
227
|
+
playerStateObserver = player.observe(\.status, options: [.new, .initial]) { [weak self] player, _ in
|
|
228
|
+
DispatchQueue.main.async {
|
|
229
|
+
let state = self?.mapPlayerStateToAndroid(player.status) ?? PlaybackState.idle.rawValue
|
|
230
|
+
self?.onPlayerStateChanged?(["playbackState": state])
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
timeControlStatusObserver = player.observe(\.timeControlStatus, options: [.new, .initial]) { [weak self] player, _ in
|
|
235
|
+
DispatchQueue.main.async {
|
|
236
|
+
let state = self?.mapPlayerStateToAndroid(player.status, timeControlStatus: player.timeControlStatus) ?? PlaybackState.idle.rawValue
|
|
237
|
+
self?.onPlayerStateChanged?(["playbackState": state])
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
private func mapPlayerStateToAndroid(_ status: AVPlayer.Status, timeControlStatus: AVPlayer.TimeControlStatus? = nil) -> Int {
|
|
243
|
+
switch status {
|
|
244
|
+
case .unknown:
|
|
245
|
+
return PlaybackState.idle.rawValue // 1
|
|
246
|
+
case .readyToPlay:
|
|
247
|
+
if timeControlStatus == .waitingToPlayAtSpecifiedRate {
|
|
248
|
+
return PlaybackState.buffering.rawValue // 2
|
|
249
|
+
}
|
|
250
|
+
return PlaybackState.ready.rawValue // 3
|
|
251
|
+
case .failed:
|
|
252
|
+
return PlaybackState.idle.rawValue // 1
|
|
253
|
+
@unknown default:
|
|
254
|
+
return PlaybackState.idle.rawValue // 1
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
183
258
|
private func setupTokenDelegate() {
|
|
184
259
|
TPStreamsDownloadModule.shared?.setAccessTokenDelegate(self)
|
|
185
260
|
}
|
|
186
261
|
|
|
187
|
-
private func parseMetadataJSON(from jsonString: NSString?) -> [String:
|
|
262
|
+
private func parseMetadataJSON(from jsonString: NSString?) -> [String: Any]? {
|
|
188
263
|
guard let metadataString = jsonString as String? else { return nil }
|
|
189
264
|
|
|
190
265
|
guard let data = metadataString.data(using: .utf8) else { return nil }
|
|
191
266
|
do {
|
|
192
|
-
if let json = try JSONSerialization.jsonObject(with: data, options: []) as? [String:
|
|
267
|
+
if let json = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] {
|
|
193
268
|
return json
|
|
194
269
|
}
|
|
195
270
|
} catch {
|
|
@@ -7,7 +7,7 @@ export interface DownloadItem {
|
|
|
7
7
|
downloadedBytes: number;
|
|
8
8
|
progressPercentage: number;
|
|
9
9
|
state: string;
|
|
10
|
-
metadata: string
|
|
10
|
+
metadata: Record<string, any>;
|
|
11
11
|
}
|
|
12
12
|
export type DownloadProgressChange = DownloadItem;
|
|
13
13
|
export type DownloadProgressListener = (downloads: DownloadProgressChange[]) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TPStreamsDownload.d.ts","sourceRoot":"","sources":["../../../src/TPStreamsDownload.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAIxD,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EA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AC,CAE5D;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE7D;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE7D;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAE9D;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAE/D;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAE1D;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAElE;AAED,wBAAgB,eAAe,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAEzD"}
|
|
@@ -19,7 +19,7 @@ export interface TPStreamsPlayerProps extends ViewProps {
|
|
|
19
19
|
offlineLicenseExpireTime?: number;
|
|
20
20
|
showDefaultCaptions?: boolean;
|
|
21
21
|
downloadMetadata?: {
|
|
22
|
-
[key: string]:
|
|
22
|
+
[key: string]: any;
|
|
23
23
|
};
|
|
24
24
|
onPlayerStateChanged?: (state: number) => void;
|
|
25
25
|
onIsPlayingChanged?: (isPlaying: boolean) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TPStreamsPlayer.d.ts","sourceRoot":"","sources":["../../../src/TPStreamsPlayer.tsx"],"names":[],"mappings":";AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAc9C,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IA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SAAQ,SAAS;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,gBAAgB,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAC1C,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,KAAK,IAAI,CAAC;IACX,oBAAoB,CAAC,EAAE,CACrB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,KACjC,IAAI,CAAC;CACX;AAED;;;GAGG;AACH,QAAA,MAAM,mBAAmB,qHAyMvB,CAAC;AAEH,eAAe,mBAAmB,CAAC"}
|
package/package.json
CHANGED
package/src/TPStreamsPlayer.tsx
CHANGED
|
@@ -40,7 +40,7 @@ export interface TPStreamsPlayerProps extends ViewProps {
|
|
|
40
40
|
enableDownload?: boolean;
|
|
41
41
|
offlineLicenseExpireTime?: number;
|
|
42
42
|
showDefaultCaptions?: boolean;
|
|
43
|
-
downloadMetadata?: { [key: string]:
|
|
43
|
+
downloadMetadata?: { [key: string]: any };
|
|
44
44
|
onPlayerStateChanged?: (state: number) => void;
|
|
45
45
|
onIsPlayingChanged?: (isPlaying: boolean) => void;
|
|
46
46
|
onPlaybackSpeedChanged?: (speed: number) => void;
|