vdocipher-rn-bridge 1.17.0 → 1.17.2
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/android/build.gradle +3 -3
- package/downloads.ts +0 -26
- package/ios/RCTVdoPlayerUIView.swift +4 -42
- package/ios/RCTVdoPlayerView.swift +4 -41
- package/ios/TrackSelection.swift +0 -4
- package/ios/VdoCipherRNView.swift +89 -15
- package/ios/VdoDownload.swift +397 -22
- package/ios/VdoEventEmitter.swift +0 -9
- package/ios/VdocipherRnBridgeViewManager.m +8 -1
- package/ios/VdocipherRnBridgeViewManager.swift +1 -2
- package/package.json +2 -2
- package/react-native-vdocipher-rn-bridge.podspec +1 -1
- package/CHANGELOG.md +0 -153
- package/android/src/.DS_Store +0 -0
- package/android/src/main/.DS_Store +0 -0
- package/android/src/main/java/com/vdocipher/.DS_Store +0 -0
- package/ios/.DS_Store +0 -0
package/android/build.gradle
CHANGED
|
@@ -18,8 +18,8 @@ apply plugin: 'com.android.library'
|
|
|
18
18
|
// TODO read from package.json
|
|
19
19
|
// "releaseVersionName" must be the same as "version" in package.json
|
|
20
20
|
// "releaseVersionCode" must increment by 1 with every release
|
|
21
|
-
def releaseVersionName = "1.17.
|
|
22
|
-
def releaseVersionCode =
|
|
21
|
+
def releaseVersionName = "1.17.2"
|
|
22
|
+
def releaseVersionCode = 23
|
|
23
23
|
|
|
24
24
|
android {
|
|
25
25
|
compileSdkVersion 33
|
|
@@ -86,5 +86,5 @@ repositories {
|
|
|
86
86
|
dependencies {
|
|
87
87
|
compileOnly 'com.facebook.react:react-native:+'
|
|
88
88
|
implementation 'androidx.appcompat:appcompat:1.3.1'
|
|
89
|
-
implementation 'com.vdocipher.aegis:vdocipher-android:1.
|
|
89
|
+
implementation 'com.vdocipher.aegis:vdocipher-android:1.23.0'
|
|
90
90
|
}
|
package/downloads.ts
CHANGED
|
@@ -14,13 +14,6 @@ const { VdoDownload } = NativeModules;
|
|
|
14
14
|
|
|
15
15
|
const getDownloadOptions = (optionParams: VdoTypes.OfflineOptionParams) => {
|
|
16
16
|
|
|
17
|
-
if (Platform.OS == 'ios') {
|
|
18
|
-
console.warn("Download methods not supported in iOS");
|
|
19
|
-
return new Promise(function(resolve, reject) {
|
|
20
|
-
reject({errorCode: -1, errorMsg: "Download methods not supported in iOS", httpStatusCode: -1});
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
17
|
return new Promise(function(resolve, reject) {
|
|
25
18
|
VdoDownload.getDownloadOptions(
|
|
26
19
|
optionParams,
|
|
@@ -39,12 +32,6 @@ const getDownloadOptions = (optionParams: VdoTypes.OfflineOptionParams) => {
|
|
|
39
32
|
|
|
40
33
|
const getEnqueueFn = (nativeId: string) => (downloadOptions: {selections: Array<number>}) => {
|
|
41
34
|
|
|
42
|
-
if (Platform.OS == 'ios') {
|
|
43
|
-
console.warn("Download methods not supported in iOS");
|
|
44
|
-
return new Promise(function(resolve, reject) {
|
|
45
|
-
reject({exception: null, msg: "Download methods not supported in iOS"});
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
35
|
|
|
49
36
|
return new Promise<void>(function(resolve, reject) {
|
|
50
37
|
const requestOptions = {
|
|
@@ -67,12 +54,6 @@ const getEnqueueFn = (nativeId: string) => (downloadOptions: {selections: Array<
|
|
|
67
54
|
|
|
68
55
|
const query = (queryFilters: {mediaId: Array<string>, status: Array<string>}) => {
|
|
69
56
|
|
|
70
|
-
if (Platform.OS == 'ios') {
|
|
71
|
-
console.warn("Download methods not supported in iOS");
|
|
72
|
-
return new Promise(function(resolve, reject) {
|
|
73
|
-
reject({exception: "", msg: "Download methods not supported in iOS"});
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
57
|
|
|
77
58
|
return new Promise(function(resolve, reject) {
|
|
78
59
|
VdoDownload.query(
|
|
@@ -90,13 +71,6 @@ const query = (queryFilters: {mediaId: Array<string>, status: Array<string>}) =>
|
|
|
90
71
|
|
|
91
72
|
const remove = (mediaIds: Array<string>) => {
|
|
92
73
|
|
|
93
|
-
if (Platform.OS == 'ios') {
|
|
94
|
-
console.warn("Download methods not supported in iOS");
|
|
95
|
-
return new Promise(function(resolve, reject) {
|
|
96
|
-
reject({exception: "", msg: "Download methods not supported in iOS"});
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
|
|
100
74
|
return new Promise<void>(function(resolve, reject) {
|
|
101
75
|
VdoDownload.remove(
|
|
102
76
|
mediaIds,
|
|
@@ -26,49 +26,11 @@ class RCTVdoPlayerUIView: VdoCipherRNView {
|
|
|
26
26
|
self.addSubview(playerViewController.view)
|
|
27
27
|
playerViewController.didMove(toParent: self.reactViewController())
|
|
28
28
|
self.reactViewController().navigationController?.delegate = self
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
let errorDescription = ErrorDescription(errorCode: 4101,
|
|
34
|
-
errorMsg: "Error: 4101 Invalid video parameters. Please contact the app developer.",
|
|
35
|
-
httpStatusCode: -1)
|
|
36
|
-
self.sendErrorEventWithDescription(errorDescription)
|
|
37
|
-
return
|
|
29
|
+
if embedInfo["offline"] as? Bool == true {
|
|
30
|
+
self.parseOfflineCredentials(fromInfo: embedInfo)
|
|
31
|
+
} else {
|
|
32
|
+
self.parseOnlineCredentials(fromInfo: embedInfo)
|
|
38
33
|
}
|
|
39
|
-
let customPlayerId = embedInfo["customPlayerId"] as? String
|
|
40
|
-
let preferredCaptionsLanguage = embedInfo["preferredCaptionsLanguage"] as? String
|
|
41
|
-
let enableAutoResume = embedInfo["enableAutoResume"] as? Bool
|
|
42
|
-
if enableAutoResume == false {
|
|
43
|
-
let userDefaults: UserDefaults? = UserDefaults.init(suiteName: "com.vdocipher.ios.VdoFramework")
|
|
44
|
-
if var assetsLastPlaybackTimeSet = userDefaults?.value(forKey: "assetsLastPlaybackTimeSet") as? [String: Double] {
|
|
45
|
-
assetsLastPlaybackTimeSet[parsed.videoId] = Double(0)
|
|
46
|
-
userDefaults?.set(assetsLastPlaybackTimeSet, forKey: "assetsLastPlaybackTimeSet")
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
VdoAsset.createAsset(videoId: parsed.videoId, playerId: customPlayerId, onLoad: { asset, err in
|
|
50
|
-
DispatchQueue.main.async {
|
|
51
|
-
guard let asset = asset else {
|
|
52
|
-
if let error = err {
|
|
53
|
-
let errorDescription = ErrorDescription(errorCode: error.code, errorMsg: error.message, httpStatusCode: -1)
|
|
54
|
-
self.sendErrorEventWithDescription(errorDescription)
|
|
55
|
-
}
|
|
56
|
-
return
|
|
57
|
-
}
|
|
58
|
-
self.asset = asset
|
|
59
|
-
TrackSelection.asset = asset
|
|
60
|
-
if preferredCaptionsLanguage?.isEmpty == false {
|
|
61
|
-
DispatchQueue.main.async {
|
|
62
|
-
_ = self.setCaptionLanguage(lanCode: preferredCaptionsLanguage)
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
if asset.downloadState == .downloaded {
|
|
66
|
-
asset.playOffline()
|
|
67
|
-
} else {
|
|
68
|
-
asset.playOnline(otp: otp, playbackInfo: playbackInfo)
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
34
|
})
|
|
73
35
|
}
|
|
74
36
|
}
|
|
@@ -21,48 +21,11 @@ class RCTVdoPlayerView: VdoCipherRNView {
|
|
|
21
21
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.33 , execute: {
|
|
22
22
|
self.reactViewController().navigationController?.delegate = self
|
|
23
23
|
})
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
let errorDescription = ErrorDescription(errorCode: 4101,
|
|
29
|
-
errorMsg: "Error: 4101 Invalid video parameters. Please contact the app developer.",
|
|
30
|
-
httpStatusCode: -1)
|
|
31
|
-
self.sendErrorEventWithDescription(errorDescription)
|
|
32
|
-
return
|
|
24
|
+
if embedInfo["offline"] as? Bool == true {
|
|
25
|
+
self.parseOfflineCredentials(fromInfo: embedInfo)
|
|
26
|
+
} else {
|
|
27
|
+
self.parseOnlineCredentials(fromInfo: embedInfo)
|
|
33
28
|
}
|
|
34
|
-
let preferredCaptionsLanguage = embedInfo["preferredCaptionsLanguage"] as? String
|
|
35
|
-
let enableAutoResume = embedInfo["enableAutoResume"] as? Bool
|
|
36
|
-
if enableAutoResume == false {
|
|
37
|
-
let userDefaults: UserDefaults? = UserDefaults.init(suiteName: "com.vdocipher.ios.VdoFramework")
|
|
38
|
-
if var assetsLastPlaybackTimeSet = userDefaults?.value(forKey: "assetsLastPlaybackTimeSet") as? [String: Double] {
|
|
39
|
-
assetsLastPlaybackTimeSet[parsed.videoId] = Double(0)
|
|
40
|
-
userDefaults?.set(assetsLastPlaybackTimeSet, forKey: "assetsLastPlaybackTimeSet")
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
VdoAsset.createAsset(videoId: parsed.videoId, onLoad: { asset, err in
|
|
44
|
-
DispatchQueue.main.async {
|
|
45
|
-
guard let asset = asset else {
|
|
46
|
-
if let error = err {
|
|
47
|
-
let errorDescription = ErrorDescription(errorCode: error.code, errorMsg: error.message, httpStatusCode: -1)
|
|
48
|
-
self.sendErrorEventWithDescription(errorDescription)
|
|
49
|
-
}
|
|
50
|
-
return
|
|
51
|
-
}
|
|
52
|
-
self.asset = asset
|
|
53
|
-
TrackSelection.asset = asset
|
|
54
|
-
if preferredCaptionsLanguage?.isEmpty == false {
|
|
55
|
-
DispatchQueue.main.async {
|
|
56
|
-
_ = self.setCaptionLanguage(lanCode: preferredCaptionsLanguage)
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
if asset.downloadState == .downloaded {
|
|
60
|
-
asset.playOffline()
|
|
61
|
-
} else {
|
|
62
|
-
asset.playOnline(otp: otp, playbackInfo: playbackInfo)
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
})
|
|
66
29
|
}
|
|
67
30
|
|
|
68
31
|
override func playerReadyToPlay() {
|
package/ios/TrackSelection.swift
CHANGED
|
@@ -36,7 +36,6 @@ class TrackSelection: NSObject {
|
|
|
36
36
|
static var captionLanguagesMap: [[String: Any]]?
|
|
37
37
|
|
|
38
38
|
@objc func getCaptionLanguages(_ callback: RCTResponseSenderBlock) {
|
|
39
|
-
// print("========= TrackSelection getCaptionLanguages called")
|
|
40
39
|
guard let captionLanguagesMap = TrackSelection.captionLanguagesMap else {
|
|
41
40
|
callback(nil)
|
|
42
41
|
return
|
|
@@ -45,19 +44,16 @@ class TrackSelection: NSObject {
|
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
@objc func getSelectedCaptionLanguage(_ callback: RCTResponseSenderBlock) {
|
|
48
|
-
// print("========= TrackSelection getSelectedCaptionLanguage called")
|
|
49
47
|
guard let selectedCaption = TrackSelection.asset?.getCurrentEnabledCaption(),
|
|
50
48
|
let name = selectedCaption.captionName,
|
|
51
49
|
let selectedCaptionMap = TrackSelection.captionLanguagesMap?.first(where: {$0["name"] as? String == name}) else {
|
|
52
50
|
callback([])
|
|
53
51
|
return
|
|
54
52
|
}
|
|
55
|
-
// print("Selected Caption Map is \(selectedCaptionMap)")
|
|
56
53
|
callback([selectedCaptionMap])
|
|
57
54
|
}
|
|
58
55
|
|
|
59
56
|
@objc func getDuration(_ callback: RCTResponseSenderBlock) {
|
|
60
|
-
// print("========= TrackSelection getDuration called")
|
|
61
57
|
guard let duration = TrackSelection.asset?.duration else {return}
|
|
62
58
|
callback([["duration": duration]])
|
|
63
59
|
}
|
|
@@ -14,10 +14,12 @@ class VdoCipherRNView: UIView {
|
|
|
14
14
|
@objc var player: AVPlayer?
|
|
15
15
|
@objc var asset: VdoAsset?
|
|
16
16
|
|
|
17
|
+
private var preferredCaptionsLanguage: String?
|
|
17
18
|
private var playWhenReady: Bool = true
|
|
18
19
|
private var progressTimer: Timer?
|
|
19
20
|
private var isLoaded = false
|
|
20
21
|
private var targetPlaybackSpeed: Float = 1.0
|
|
22
|
+
private var playbackType: PlaybackType = .streaming
|
|
21
23
|
|
|
22
24
|
private var playerItemBufferEmptyObserver: NSKeyValueObservation?
|
|
23
25
|
private var playerItemBufferKeepUpObserver: NSKeyValueObservation?
|
|
@@ -49,7 +51,6 @@ class VdoCipherRNView: UIView {
|
|
|
49
51
|
guard newSuperview != nil else {
|
|
50
52
|
return
|
|
51
53
|
}
|
|
52
|
-
// print("added to a superView \(newSuperview) reactViewController is \(self.reactViewController())")
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
override func didMoveToSuperview() {
|
|
@@ -59,9 +60,7 @@ class VdoCipherRNView: UIView {
|
|
|
59
60
|
self.removeObservers()
|
|
60
61
|
player?.replaceCurrentItem(with: nil)
|
|
61
62
|
player = nil
|
|
62
|
-
}
|
|
63
|
-
// print("did move to a superView, reactViewController is \(self.reactViewController())")
|
|
64
|
-
} */
|
|
63
|
+
}
|
|
65
64
|
}
|
|
66
65
|
|
|
67
66
|
func addObserversToPlayer()
|
|
@@ -73,16 +72,25 @@ class VdoCipherRNView: UIView {
|
|
|
73
72
|
|
|
74
73
|
playerItemBufferEmptyObserver = self.player?.currentItem?.observe(\AVPlayerItem.isPlaybackBufferEmpty, options: [.new]) { [weak self] (_, _) in
|
|
75
74
|
guard let self = self else { return }
|
|
75
|
+
if self.playbackType == .offline || self.playerState == .buffering {
|
|
76
|
+
return
|
|
77
|
+
}
|
|
76
78
|
self.playerState = .buffering
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
playerItemBufferKeepUpObserver = self.player?.currentItem?.observe(\AVPlayerItem.isPlaybackLikelyToKeepUp, options: [.new]) { [weak self] (_, _) in
|
|
80
82
|
guard let self = self else { return }
|
|
83
|
+
if self.playerState == .ready {
|
|
84
|
+
return
|
|
85
|
+
}
|
|
81
86
|
self.playerState = .ready
|
|
82
87
|
}
|
|
83
88
|
|
|
84
89
|
playerItemBufferFullObserver = self.player?.currentItem?.observe(\AVPlayerItem.isPlaybackBufferFull, options: [.new]) { [weak self] (_, _) in
|
|
85
90
|
guard let self = self else { return }
|
|
91
|
+
if self.playerState == .ready {
|
|
92
|
+
return
|
|
93
|
+
}
|
|
86
94
|
self.playerState = .ready
|
|
87
95
|
}
|
|
88
96
|
|
|
@@ -93,7 +101,6 @@ class VdoCipherRNView: UIView {
|
|
|
93
101
|
|
|
94
102
|
private func sendPlayerProgress() {
|
|
95
103
|
let currentTime = Int(self.player?.currentItem?.currentTime().seconds.rounded( .down) ?? 0.0 ) * 1000
|
|
96
|
-
// print("Current time send as event emitter is \(currentTime)")
|
|
97
104
|
if currentTime > 0 {
|
|
98
105
|
EventEmitter.sharedInstance.dispatch(name: .EVENT_PROGRESS, params: [Keys.EVENT_PROP_CURRENT_TIME.rawValue : currentTime])
|
|
99
106
|
}
|
|
@@ -132,6 +139,66 @@ class VdoCipherRNView: UIView {
|
|
|
132
139
|
progressTimer = nil
|
|
133
140
|
}
|
|
134
141
|
|
|
142
|
+
func parseOfflineCredentials(fromInfo embedInfo: [String: Any]) {
|
|
143
|
+
guard let mediaId = embedInfo["mediaId"] as? String else {
|
|
144
|
+
let errorDescription = ErrorDescription(errorCode: 4101, errorMsg: "Error: 4101 Invalid video parameters. Please contact the app developer.", httpStatusCode: -1)
|
|
145
|
+
self.sendErrorEventWithDescription(errorDescription)
|
|
146
|
+
return
|
|
147
|
+
}
|
|
148
|
+
var params = embedInfo
|
|
149
|
+
if let customPlayerId = VdoDownload.getCustomPlayerIdForMediaId(mediaId) {
|
|
150
|
+
params["customPlayerId"] = customPlayerId
|
|
151
|
+
}
|
|
152
|
+
self.playbackType = .offline
|
|
153
|
+
self.initiatePlayback(withInfo: params, videoId: mediaId)
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
func parseOnlineCredentials(fromInfo embedInfo: [String: Any]) {
|
|
157
|
+
guard let playbackInfo = embedInfo["playbackInfo"] as? String,
|
|
158
|
+
let otp = embedInfo["otp"] as? String,
|
|
159
|
+
let decoded = Data(base64Encoded: playbackInfo),
|
|
160
|
+
let parsed = try? JSONDecoder().decode(PlaybackInfo.self, from: decoded) else {
|
|
161
|
+
let errorDescription = ErrorDescription(errorCode: 4101, errorMsg: "Error: 4101 Invalid video parameters. Please contact the app developer.", httpStatusCode: -1)
|
|
162
|
+
self.sendErrorEventWithDescription(errorDescription)
|
|
163
|
+
return
|
|
164
|
+
}
|
|
165
|
+
self.playbackType = .streaming
|
|
166
|
+
self.initiatePlayback(withInfo: embedInfo, videoId: parsed.videoId, onlineCredentials: Credentials(otp: otp, playbackInfo: playbackInfo))
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
private func initiatePlayback(withInfo embedInfo: [String: Any], videoId: String, onlineCredentials: Credentials? = nil) {
|
|
170
|
+
let customPlayerId = embedInfo["customPlayerId"] as? String
|
|
171
|
+
let preferredCaptionsLanguage = embedInfo["preferredCaptionsLanguage"] as? String
|
|
172
|
+
let enableAutoResume = embedInfo["enableAutoResume"] as? Bool
|
|
173
|
+
if enableAutoResume == false {
|
|
174
|
+
let userDefaults: UserDefaults? = UserDefaults.init(suiteName: "com.vdocipher.ios.VdoFramework")
|
|
175
|
+
if var assetsLastPlaybackTimeSet = userDefaults?.value(forKey: "assetsLastPlaybackTimeSet") as? [String: Double] {
|
|
176
|
+
assetsLastPlaybackTimeSet[videoId] = Double(0)
|
|
177
|
+
userDefaults?.set(assetsLastPlaybackTimeSet, forKey: "assetsLastPlaybackTimeSet")
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
VdoAsset.createAsset(videoId: videoId, playerId: customPlayerId, onLoad: { asset, err in
|
|
181
|
+
DispatchQueue.main.async {
|
|
182
|
+
guard let asset = asset else {
|
|
183
|
+
if let error = err {
|
|
184
|
+
let errorDescription = ErrorDescription(errorCode: error.code, errorMsg: error.message, httpStatusCode: -1)
|
|
185
|
+
self.sendErrorEventWithDescription(errorDescription)
|
|
186
|
+
}
|
|
187
|
+
return
|
|
188
|
+
}
|
|
189
|
+
self.asset = asset
|
|
190
|
+
TrackSelection.asset = asset
|
|
191
|
+
self.preferredCaptionsLanguage = preferredCaptionsLanguage
|
|
192
|
+
if let onlineCredentials = onlineCredentials {
|
|
193
|
+
asset.playOnline(otp: onlineCredentials.otp, playbackInfo: onlineCredentials.playbackInfo)
|
|
194
|
+
} else {
|
|
195
|
+
asset.playOffline()
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
})
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
|
|
135
202
|
@objc func videoDidEnd(notification: NSNotification) {
|
|
136
203
|
if self.playerState == .ended {
|
|
137
204
|
return
|
|
@@ -144,6 +211,11 @@ class VdoCipherRNView: UIView {
|
|
|
144
211
|
|
|
145
212
|
@objc func playerReadyToPlay() {
|
|
146
213
|
self.playerState = .ready
|
|
214
|
+
if self.preferredCaptionsLanguage?.isEmpty == false {
|
|
215
|
+
DispatchQueue.main.async {
|
|
216
|
+
_ = self.setCaptionLanguage(lanCode: self.preferredCaptionsLanguage)
|
|
217
|
+
}
|
|
218
|
+
}
|
|
147
219
|
if self.playWhenReady == true {
|
|
148
220
|
self.player?.rate = targetPlaybackSpeed
|
|
149
221
|
} else {
|
|
@@ -152,15 +224,12 @@ class VdoCipherRNView: UIView {
|
|
|
152
224
|
}
|
|
153
225
|
|
|
154
226
|
@objc func setEmbedInfo(_ embedInfo: [String: Any]) {
|
|
155
|
-
// print("Embed Info is \(embedInfo)")
|
|
156
227
|
}
|
|
157
228
|
|
|
158
229
|
@objc func setResizeMode(_ resizeMode: String) {
|
|
159
|
-
// print("Resize Mode called with value == \(resizeMode)")
|
|
160
230
|
}
|
|
161
231
|
|
|
162
232
|
@objc func setPlayWhenReady(_ playWhenReady: Bool) {
|
|
163
|
-
// print("playWhenReady called with value == \(playWhenReady)")
|
|
164
233
|
self.playWhenReady = playWhenReady
|
|
165
234
|
if playWhenReady == true {
|
|
166
235
|
if targetPlaybackSpeed == 0 {
|
|
@@ -177,20 +246,17 @@ class VdoCipherRNView: UIView {
|
|
|
177
246
|
}
|
|
178
247
|
|
|
179
248
|
@objc func setPlaybackSpeed(_ speed: Float) {
|
|
180
|
-
// print("playbackSpeed called with value == \(speed)")
|
|
181
249
|
self.targetPlaybackSpeed = speed
|
|
182
250
|
self.player?.rate = speed
|
|
183
251
|
EventEmitter.sharedInstance.dispatch(name: .EVENT_PLAYBACK_SPEED_CHANGED, params: [Keys.EVENT_PROP_PLAYBACK_SPEED.rawValue : speed])
|
|
184
252
|
}
|
|
185
253
|
|
|
186
254
|
@objc func setSeek(_ seekTime: Int) {
|
|
187
|
-
// print("seek called with value == \(seekTime)")
|
|
188
255
|
self.player?.seek(to: CMTime(value: CMTimeValue(seekTime), timescale: 1000))
|
|
189
256
|
|
|
190
257
|
}
|
|
191
258
|
|
|
192
259
|
@objc func setCaptionLanguage(_ caption: [String: Any]) {
|
|
193
|
-
// print("========= TrackSelection setCaptionLanguage called")
|
|
194
260
|
guard let asset = TrackSelection.asset,
|
|
195
261
|
let captions = asset.captions,
|
|
196
262
|
let selectedCaptionName = caption["name"] as? String,
|
|
@@ -206,7 +272,6 @@ class VdoCipherRNView: UIView {
|
|
|
206
272
|
}
|
|
207
273
|
|
|
208
274
|
@objc func setDisableCaptions(_ val: Int) {
|
|
209
|
-
// print("========= TrackSelection disableCaptions called")
|
|
210
275
|
if (TrackSelection.asset?.setCaption(nil) == true) {
|
|
211
276
|
EventEmitter.sharedInstance.dispatch(name: .EVENT_TRACKS_CHANGED, params: [Keys.EVENT_PROP_AVAILABLE_TRACKS.rawValue : TrackSelection.captionLanguagesMap ?? []])
|
|
212
277
|
}
|
|
@@ -255,7 +320,7 @@ extension VdoCipherRNView: AssetPlaybackDelegate {
|
|
|
255
320
|
|
|
256
321
|
guard let asset = asset else { return }
|
|
257
322
|
let mInfo = Media(mediaId: asset.videoId,
|
|
258
|
-
type:
|
|
323
|
+
type: playbackType.rawValue,
|
|
259
324
|
title: asset.title ?? "",
|
|
260
325
|
description: asset.description,
|
|
261
326
|
duration: (Int(asset.duration ?? 0.0) * 1000) )
|
|
@@ -303,10 +368,19 @@ extension VdoCipherRNView: UINavigationControllerDelegate {
|
|
|
303
368
|
}
|
|
304
369
|
}
|
|
305
370
|
|
|
306
|
-
private enum PlayerState : String
|
|
307
|
-
{
|
|
371
|
+
private enum PlayerState : String {
|
|
308
372
|
case buffering = "buffering",
|
|
309
373
|
ready = "ready",
|
|
310
374
|
ended = "ended",
|
|
311
375
|
unknown = "unknown"
|
|
312
376
|
}
|
|
377
|
+
|
|
378
|
+
fileprivate struct Credentials {
|
|
379
|
+
let otp: String
|
|
380
|
+
let playbackInfo: String
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
private enum PlaybackType: String {
|
|
384
|
+
case streaming
|
|
385
|
+
case offline
|
|
386
|
+
}
|
package/ios/VdoDownload.swift
CHANGED
|
@@ -9,31 +9,26 @@ import Foundation
|
|
|
9
9
|
import React
|
|
10
10
|
|
|
11
11
|
class DownloadEventEmitter {
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
/// Shared Instance.
|
|
14
14
|
public static var sharedInstance = DownloadEventEmitter()
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
// ReactNativeEventEmitter is instantiated by React Native with the bridge.
|
|
17
17
|
private static var eventEmitter: VdoDownload!
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
private init() {}
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
// When React Native instantiates the emitter it is registered here.
|
|
22
22
|
func registerEventEmitter(eventEmitter: VdoDownload) {
|
|
23
23
|
DownloadEventEmitter.eventEmitter = eventEmitter
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
func dispatch(name: DownloadEventName, params: [String: Any]?) {
|
|
27
27
|
if DownloadEventEmitter.eventEmitter.hasListener == true {
|
|
28
|
-
|
|
29
|
-
if let p = params {
|
|
30
|
-
data["nativeEvent"] = p
|
|
31
|
-
}
|
|
32
|
-
// print("event data sent is \(data)")
|
|
33
|
-
DownloadEventEmitter.eventEmitter.sendEvent(withName: name.rawValue, body: data)
|
|
28
|
+
DownloadEventEmitter.eventEmitter.sendEvent(withName: name.rawValue, body: params)
|
|
34
29
|
}
|
|
35
30
|
}
|
|
36
|
-
|
|
31
|
+
|
|
37
32
|
/// All Events which must be support by React Native.
|
|
38
33
|
lazy var allEvents: [String] = {
|
|
39
34
|
|
|
@@ -50,13 +45,36 @@ enum DownloadEventName: String, CaseIterable {
|
|
|
50
45
|
case EVENT_DELETED = "onDeleted"
|
|
51
46
|
}
|
|
52
47
|
|
|
48
|
+
//enum DownloadStatusKeys: String {
|
|
49
|
+
// case EVENT_PROP_DOWNLOAD_STATUS_MEDIA_INFO = "mediaInfo"
|
|
50
|
+
// case EVENT_PROP_DOWNLOAD_STATUS_LOCAL_STORAGE_FOLDER = "localStorageFolder"
|
|
51
|
+
// case EVENT_PROP_DOWNLOAD_STATUS_STATUS = "status"
|
|
52
|
+
// case EVENT_PROP_DOWNLOAD_STATUS_REASON = "reason"
|
|
53
|
+
// case EVENT_PROP_DOWNLOAD_STATUS_REASON_DESCRIPTION = "reasonDescription"
|
|
54
|
+
// case EVENT_PROP_DOWNLOAD_STATUS_TOTAL_SIZE_BYTES = "totalSizeBytes"
|
|
55
|
+
// case EVENT_PROP_DOWNLOAD_STATUS_BYTES_DOWNLOADED = "bytesDownloaded"
|
|
56
|
+
// case EVENT_PROP_DOWNLOAD_STATUS_DOWNLOAD_PERCENT = "downloadPercent"
|
|
57
|
+
// case EVENT_PROP_DOWNLOAD_STATUS_POSTER = "poster"
|
|
58
|
+
// case EVENT_PROP_DOWNLOAD_STATUS_LAST_MODIFIED_TIMESTAMP = "lastModifiedTimestamp"
|
|
59
|
+
//}
|
|
60
|
+
|
|
53
61
|
@objc(VdoDownload)
|
|
54
62
|
class VdoDownload: RCTEventEmitter {
|
|
55
63
|
|
|
64
|
+
var asset: VdoAsset?
|
|
65
|
+
var availableTracksMap: [[String: Any]]?
|
|
66
|
+
var optionParams: [String: Any]?
|
|
67
|
+
|
|
68
|
+
// MARK: RCTEventEmitter functions
|
|
56
69
|
override init() {
|
|
57
70
|
super.init()
|
|
58
|
-
// print("\(type(of: self))).\(#function)")
|
|
59
71
|
DownloadEventEmitter.sharedInstance.registerEventEmitter(eventEmitter: self)
|
|
72
|
+
self.addDownloadObservers()
|
|
73
|
+
VdoCipher.logLevel = .info
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
deinit {
|
|
77
|
+
self.removeObservers()
|
|
60
78
|
}
|
|
61
79
|
|
|
62
80
|
var hasListener: Bool?
|
|
@@ -65,39 +83,396 @@ class VdoDownload: RCTEventEmitter {
|
|
|
65
83
|
///
|
|
66
84
|
/// - Returns: all supported events
|
|
67
85
|
@objc open override func supportedEvents() -> [String] {
|
|
68
|
-
// print("\(type(of: self))).\(#function)")
|
|
69
86
|
return DownloadEventEmitter.sharedInstance.allEvents
|
|
70
87
|
}
|
|
71
88
|
|
|
72
89
|
@objc open override func startObserving() {
|
|
73
90
|
super.startObserving()
|
|
74
91
|
hasListener = true
|
|
75
|
-
// print("\(type(of: self))).\(#function)")
|
|
76
92
|
}
|
|
77
|
-
|
|
93
|
+
|
|
78
94
|
@objc open override func stopObserving() {
|
|
79
95
|
super.stopObserving()
|
|
80
96
|
hasListener = false
|
|
81
|
-
// print("\(type(of: self))).\(#function)")
|
|
82
97
|
}
|
|
83
98
|
|
|
84
99
|
open override class func requiresMainQueueSetup() -> Bool {
|
|
85
|
-
// print("\(type(of: self))).\(#function)")
|
|
86
100
|
return true
|
|
87
101
|
}
|
|
88
102
|
|
|
89
103
|
open override func addListener(_ eventName: String!) {
|
|
90
104
|
super.addListener(eventName)
|
|
91
|
-
// print("\(type(of: self))).\(#function) eventName: \(eventName)")
|
|
92
105
|
}
|
|
93
106
|
|
|
94
107
|
open override func removeListeners(_ count: Double) {
|
|
95
108
|
super.removeListeners(count)
|
|
96
|
-
// print("\(type(of: self))).\(#function) count: \(count)")
|
|
97
109
|
}
|
|
98
|
-
|
|
110
|
+
|
|
99
111
|
open override func invalidate() {
|
|
100
112
|
super.invalidate()
|
|
101
|
-
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// MARK: Download functionality
|
|
116
|
+
@objc func query(_ queryFilters: [String: Any], errorCallback: RCTResponseSenderBlock, successCallback: RCTResponseSenderBlock) {
|
|
117
|
+
let mediaIdsRaw = queryFilters["mediaId"] as? [String]
|
|
118
|
+
let statusNames = queryFilters["status"] as? [String]
|
|
119
|
+
var mediaIds : [String] = []
|
|
120
|
+
if let mediaIdsRaw = mediaIdsRaw {
|
|
121
|
+
mediaIds = mediaIdsRaw
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
let downloadStates: [VdoAsset.DownloadState] = getDownloadStateList(downloadStatesRaw: statusNames)
|
|
125
|
+
|
|
126
|
+
let downloadFilter : DownloadInfoFilter
|
|
127
|
+
if downloadStates.count != 0 {
|
|
128
|
+
downloadFilter = DownloadInfoFilter (videoId: mediaIds.count != 0 ? mediaIds : nil, downloadState: downloadStates)
|
|
129
|
+
}
|
|
130
|
+
else{
|
|
131
|
+
downloadFilter = DownloadInfoFilter (videoId: mediaIds.count != 0 ? mediaIds : nil)
|
|
132
|
+
}
|
|
133
|
+
let downloadedAssests = VdoCipher.getListOfDownloads(filterBy: downloadFilter).map { self.createOfflineVdoAssetMap(with: $0) }
|
|
134
|
+
successCallback([downloadedAssests])
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
private func getDownloadStateList(downloadStatesRaw : [String]?) -> [VdoAsset.DownloadState]{
|
|
138
|
+
var downloadStates : [VdoAsset.DownloadState] = []
|
|
139
|
+
if let downloadStatesRaw = downloadStatesRaw {
|
|
140
|
+
for downloadState in downloadStatesRaw {
|
|
141
|
+
switch(downloadState){
|
|
142
|
+
case "completed":
|
|
143
|
+
downloadStates.append(.downloaded)
|
|
144
|
+
break;
|
|
145
|
+
case "pending":
|
|
146
|
+
downloadStates.append(.notDownloaded)
|
|
147
|
+
break;
|
|
148
|
+
case "paused":
|
|
149
|
+
downloadStates.append(.paused)
|
|
150
|
+
break;
|
|
151
|
+
case "downloading":
|
|
152
|
+
downloadStates.append(.downloading)
|
|
153
|
+
break;
|
|
154
|
+
default:
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return downloadStates
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@objc func getDownloadOptions(_ optionParams: [String: Any], errorCallback: @escaping RCTResponseSenderBlock, successCallback: @escaping RCTResponseSenderBlock) {
|
|
163
|
+
guard let playbackInfo = optionParams["playbackInfo"] as? String,
|
|
164
|
+
let decoded = Data(base64Encoded: playbackInfo),
|
|
165
|
+
let parsed = try? JSONDecoder().decode(PlaybackInfo.self, from: decoded),
|
|
166
|
+
let _ = optionParams["otp"] as? String else {
|
|
167
|
+
errorCallback([[Error_Keys.EVENT_PROP_ERROR_CODE.rawValue: "-1",
|
|
168
|
+
Error_Keys.EVENT_PROP_ERROR_MSG.rawValue: "PlaybackInfo or OTP not found"]])
|
|
169
|
+
|
|
170
|
+
return
|
|
171
|
+
}
|
|
172
|
+
let customPlayerId = optionParams["customPlayerId"] as? String
|
|
173
|
+
VdoAsset.createAsset(videoId: parsed.videoId, playerId: customPlayerId, onLoad: { asset, err in
|
|
174
|
+
guard let asset = asset else {
|
|
175
|
+
if let error = err {
|
|
176
|
+
errorCallback([[Error_Keys.EVENT_PROP_ERROR_CODE.rawValue: error.code,
|
|
177
|
+
Error_Keys.EVENT_PROP_ERROR_MSG.rawValue: error.message] as [String : Any]])
|
|
178
|
+
} else {
|
|
179
|
+
errorCallback([[Error_Keys.EVENT_PROP_ERROR_CODE.rawValue: "-1",
|
|
180
|
+
Error_Keys.EVENT_PROP_ERROR_MSG.rawValue: "Unknown error occured"]])
|
|
181
|
+
}
|
|
182
|
+
return
|
|
183
|
+
}
|
|
184
|
+
let qualities = asset.getVideoQualities()
|
|
185
|
+
if qualities.count == 0 {
|
|
186
|
+
errorCallback([[Error_Keys.EVENT_PROP_ERROR_CODE.rawValue: "-1",
|
|
187
|
+
Error_Keys.EVENT_PROP_ERROR_MSG.rawValue: "Tracks Not Found"]])
|
|
188
|
+
return
|
|
189
|
+
}
|
|
190
|
+
let availableTracks = self.createTracksMap(with: qualities)
|
|
191
|
+
self.availableTracksMap = availableTracks
|
|
192
|
+
self.asset = asset
|
|
193
|
+
self.optionParams = optionParams
|
|
194
|
+
let mediaInfo = self.createMediaInfoMap(with: asset)
|
|
195
|
+
let downloadOptions = self.createDownloadOptionsMap(with: availableTracks, mediaInfo: mediaInfo)
|
|
196
|
+
let downloadOptionsMap = [playbackInfo, downloadOptions] as [Any]
|
|
197
|
+
successCallback(downloadOptionsMap)
|
|
198
|
+
})
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
@objc func enqueueDownload(_ nativeId: String, requestOptions: [String: Any], errorCallback: @escaping RCTResponseSenderBlock, successCallback: @escaping RCTResponseSenderBlock) {
|
|
202
|
+
guard let optionParams = optionParams, let otp = optionParams["otp"] as? String, let playbackInfo = optionParams["playbackInfo"] as? String else {
|
|
203
|
+
errorCallback([[Error_Keys.EVENT_PROP_ERROR_CODE.rawValue: "-1",
|
|
204
|
+
Error_Keys.EVENT_PROP_ERROR_MSG.rawValue: "PlaybackInfo or OTP not found"]])
|
|
205
|
+
return
|
|
206
|
+
}
|
|
207
|
+
if nativeId != playbackInfo {
|
|
208
|
+
// This is to overcome a condition if last 'getDownloadOptions' api was called for a different mediaId. Since, otp is passed with 'getDownloadOptions' and not with 'enqueue' we need to rely on 'getDownloadOptions'. Also, ReactNative apis are designed in a way that 'enqueue' func is returned on calling 'getDownloadOptions' but 'enqueue' cannot be called indvidually.
|
|
209
|
+
errorCallback([[Error_Keys.EVENT_PROP_ERROR_CODE.rawValue: "-1",
|
|
210
|
+
Error_Keys.EVENT_PROP_ERROR_MSG.rawValue: "Call getDownloadOptions before calling enqueue"]])
|
|
211
|
+
return
|
|
212
|
+
}
|
|
213
|
+
guard let asset = asset else {
|
|
214
|
+
errorCallback([[Error_Keys.EVENT_PROP_ERROR_CODE.rawValue: "-1",
|
|
215
|
+
Error_Keys.EVENT_PROP_ERROR_MSG.rawValue: "Unknown error occured"]])
|
|
216
|
+
return
|
|
217
|
+
}
|
|
218
|
+
VdoDownload.saveCustomPlayerIdForMediaId(asset.videoId, playerId: optionParams["customPlayerId"] as? String)
|
|
219
|
+
if let selections = requestOptions["selections"] as? [Int],
|
|
220
|
+
let index = selections.first,
|
|
221
|
+
asset.getVideoQualities().count > index {
|
|
222
|
+
// assuming index from 'availableTracksMap' is equivalent to index of 'asset.getVideoQualities()' as both are ordered pairs
|
|
223
|
+
asset.startDownload(otp: otp, playbackInfo: playbackInfo, videoQuality: asset.getVideoQualities()[index])
|
|
224
|
+
asset.percentDownload = 0
|
|
225
|
+
successCallback([])
|
|
226
|
+
} else {
|
|
227
|
+
errorCallback([[Error_Keys.EVENT_PROP_ERROR_CODE.rawValue: "-1",
|
|
228
|
+
Error_Keys.EVENT_PROP_ERROR_MSG.rawValue: "Invalid selection"]])
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
@objc func stop(_ mediaIds: [String], errorCallback: @escaping RCTResponseSenderBlock, successCallback: @escaping RCTResponseSenderBlock) {
|
|
233
|
+
for mediaId in mediaIds {
|
|
234
|
+
let customPlayerId = VdoDownload.getCustomPlayerIdForMediaId(mediaId)
|
|
235
|
+
VdoAsset.createAsset(videoId: mediaId, playerId: customPlayerId) { asset, error in
|
|
236
|
+
if let asset = asset {
|
|
237
|
+
asset.pauseDownload()
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
successCallback([])
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
@objc func resume(_ mediaIds: [String], errorCallback: @escaping RCTResponseSenderBlock, successCallback: @escaping RCTResponseSenderBlock) {
|
|
245
|
+
for mediaId in mediaIds {
|
|
246
|
+
let customPlayerId = VdoDownload.getCustomPlayerIdForMediaId(mediaId)
|
|
247
|
+
VdoAsset.createAsset(videoId: mediaId, playerId: customPlayerId) { asset, error in
|
|
248
|
+
if let asset = asset {
|
|
249
|
+
asset.resumeDownload()
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
successCallback([])
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
@objc func remove(_ mediaIds: [String], errorCallback: @escaping RCTResponseSenderBlock, successCallback: @escaping RCTResponseSenderBlock ) {
|
|
258
|
+
for mediaId in mediaIds {
|
|
259
|
+
let customPlayerId = VdoDownload.getCustomPlayerIdForMediaId(mediaId)
|
|
260
|
+
VdoAsset.createAsset(videoId: mediaId, playerId: customPlayerId) { asset, error in
|
|
261
|
+
if let asset = asset {
|
|
262
|
+
if asset.downloadState == .downloading || asset.downloadState == .paused {
|
|
263
|
+
asset.cancelDownload()
|
|
264
|
+
}
|
|
265
|
+
else if asset.downloadState == .downloaded {
|
|
266
|
+
asset.deleteDownload()
|
|
267
|
+
}
|
|
268
|
+
asset.percentDownload = 0
|
|
269
|
+
DownloadEventEmitter.sharedInstance.dispatch(name: .EVENT_DELETED, params: ["mediaId": asset.videoId, "downloadStatus": self.createVdoAssetMap(with: asset)])
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
successCallback([])
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// MARK: Add-Remove Observer functions
|
|
277
|
+
private func addDownloadObservers() {
|
|
278
|
+
NotificationCenter.default.addObserver(self, selector: #selector(handleDownloadProgress(_:)), name: .AssetDownloadProgress, object: nil)
|
|
279
|
+
NotificationCenter.default.addObserver(self, selector: #selector(handleDownloadStateChange(_:)), name: .AssetDownloadStateChanged, object: nil)
|
|
280
|
+
NotificationCenter.default.addObserver(self, selector: #selector(handleDownloadFailed(_:)), name: .AssetDownloadFailed, object: nil)
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
private func removeObservers() {
|
|
284
|
+
NotificationCenter.default.removeObserver(self, name: .AssetDownloadProgress, object: nil)
|
|
285
|
+
NotificationCenter.default.removeObserver(self, name: .AssetDownloadStateChanged, object: nil)
|
|
286
|
+
NotificationCenter.default.removeObserver(self, name: .AssetDownloadFailed, object: nil)
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// MARK: Notification handlers
|
|
290
|
+
@objc func handleDownloadStateChange(_ notification: Notification) {
|
|
291
|
+
let notice = notification.userInfo!
|
|
292
|
+
guard let stateRawValue = notice[VdoAsset.Keys.downloadState] as? String,
|
|
293
|
+
let newState = VdoAsset.DownloadState(rawValue: (stateRawValue)) else {
|
|
294
|
+
return
|
|
295
|
+
}
|
|
296
|
+
if newState == .notDownloaded {
|
|
297
|
+
return
|
|
298
|
+
}
|
|
299
|
+
if let videoId = notice[VdoAsset.Keys.videoId] as? String {
|
|
300
|
+
if videoId == self.asset?.videoId, let asset = asset {
|
|
301
|
+
if newState == .downloaded {
|
|
302
|
+
DownloadEventEmitter.sharedInstance.dispatch(name: .EVENT_COMPLETED, params: ["mediaId": asset.videoId, "downloadStatus": self.createVdoAssetMap(with: asset)])
|
|
303
|
+
} else if newState == .downloading {
|
|
304
|
+
DownloadEventEmitter.sharedInstance.dispatch(name: .EVENT_QUEUED, params: ["mediaId": asset.videoId, "downloadStatus": self.createVdoAssetMap(with: asset)])
|
|
305
|
+
} else {
|
|
306
|
+
DownloadEventEmitter.sharedInstance.dispatch(name: .EVENT_CHANGED, params: ["mediaId": asset.videoId, "downloadStatus": self.createVdoAssetMap(with: asset)])
|
|
307
|
+
}
|
|
308
|
+
} else {
|
|
309
|
+
let customPlayerId = VdoDownload.getCustomPlayerIdForMediaId(videoId)
|
|
310
|
+
VdoAsset.createAsset(videoId: videoId, playerId: customPlayerId) { asset, _ in
|
|
311
|
+
guard let asset = asset else { return }
|
|
312
|
+
if newState == .downloaded {
|
|
313
|
+
DownloadEventEmitter.sharedInstance.dispatch(name: .EVENT_COMPLETED, params: ["mediaId": asset.videoId, "downloadStatus": self.createVdoAssetMap(with: asset)])
|
|
314
|
+
} else if newState == .downloading {
|
|
315
|
+
DownloadEventEmitter.sharedInstance.dispatch(name: .EVENT_QUEUED, params: ["mediaId": asset.videoId, "downloadStatus": self.createVdoAssetMap(with: asset)])
|
|
316
|
+
} else {
|
|
317
|
+
DownloadEventEmitter.sharedInstance.dispatch(name: .EVENT_CHANGED, params: ["mediaId": asset.videoId, "downloadStatus": self.createVdoAssetMap(with: asset)])
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
@objc func handleDownloadProgress(_ notification: Notification) {
|
|
325
|
+
let notice = notification.userInfo!
|
|
326
|
+
guard let percentDownload = notice[VdoAsset.Keys.percentDownloaded] as? Double else {
|
|
327
|
+
return
|
|
328
|
+
}
|
|
329
|
+
if let videoId = notice[VdoAsset.Keys.videoId] as? String {
|
|
330
|
+
if videoId == self.asset?.videoId, let asset = asset {
|
|
331
|
+
asset.percentDownload = percentDownload
|
|
332
|
+
DownloadEventEmitter.sharedInstance.dispatch(name: .EVENT_CHANGED, params: ["mediaId": asset.videoId, "downloadStatus": self.createVdoAssetMap(with: asset)])
|
|
333
|
+
} else {
|
|
334
|
+
let customPlayerId = VdoDownload.getCustomPlayerIdForMediaId(videoId)
|
|
335
|
+
VdoAsset.createAsset(videoId: videoId, playerId: customPlayerId) { asset, _ in
|
|
336
|
+
guard let asset = asset else { return }
|
|
337
|
+
asset.percentDownload = percentDownload
|
|
338
|
+
DownloadEventEmitter.sharedInstance.dispatch(name: .EVENT_CHANGED, params: ["mediaId": asset.videoId, "downloadStatus": self.createVdoAssetMap(with: asset)])
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
@objc func handleDownloadFailed(_ notification: Notification) {
|
|
345
|
+
let notice = notification.userInfo!
|
|
346
|
+
guard let message = notice[VdoAsset.Keys.message] as? String, let code = notice[VdoAsset.Keys.code] else {return}
|
|
347
|
+
if let videoId = notice[VdoAsset.Keys.videoId] as? String {
|
|
348
|
+
if videoId == self.asset?.videoId, let asset = asset {
|
|
349
|
+
var assetMap = self.createVdoAssetMap(with: asset)
|
|
350
|
+
assetMap["reasonDescription"] = message
|
|
351
|
+
assetMap["reason"] = code
|
|
352
|
+
DownloadEventEmitter.sharedInstance.dispatch(name: .EVENT_FAILED, params: ["mediaId": asset.videoId, "downloadStatus": assetMap])
|
|
353
|
+
} else {
|
|
354
|
+
let customPlayerId = VdoDownload.getCustomPlayerIdForMediaId(videoId)
|
|
355
|
+
VdoAsset.createAsset(videoId: videoId, playerId: customPlayerId) { asset, _ in
|
|
356
|
+
guard let asset = asset else { return }
|
|
357
|
+
var assetMap = self.createVdoAssetMap(with: asset)
|
|
358
|
+
assetMap["reasonDescription"] = message
|
|
359
|
+
assetMap["reason"] = code
|
|
360
|
+
DownloadEventEmitter.sharedInstance.dispatch(name: .EVENT_FAILED, params: ["mediaId": asset.videoId, "downloadStatus": assetMap])
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// MARK: Map creation functions
|
|
367
|
+
private func createTracksMap(with videoQualities: [VdoFramework.VdoAsset.VideoQuality]) -> [[String: Any]] {
|
|
368
|
+
var tracks: [[String: Any]] = []
|
|
369
|
+
var counter = 1
|
|
370
|
+
for quality in videoQualities {
|
|
371
|
+
var track: [String: Any] = [:]
|
|
372
|
+
track["id"] = counter
|
|
373
|
+
track["type"] = "video"
|
|
374
|
+
track["bitrate"] = quality.bitrate
|
|
375
|
+
let resolution = quality.resolution.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
376
|
+
let size = resolution.components(separatedBy: "x")
|
|
377
|
+
if size.count == 2 {
|
|
378
|
+
track["width"] = Int(size.first ?? "") ?? 0
|
|
379
|
+
track["height"] = Int(size.last ?? "") ?? 0
|
|
380
|
+
}
|
|
381
|
+
counter += 1
|
|
382
|
+
tracks.append(track)
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
return tracks
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
private func createDownloadOptionsMap(with availableTracks: [[String: Any]], mediaInfo: [String: Any]) -> [String: Any] {
|
|
389
|
+
var downloadOptionsMap: [String: Any] = [:]
|
|
390
|
+
downloadOptionsMap["mediaId"] = mediaInfo["mediaId"]
|
|
391
|
+
downloadOptionsMap["mediaInfo"] = mediaInfo
|
|
392
|
+
downloadOptionsMap["availableTracks"] = availableTracks
|
|
393
|
+
return downloadOptionsMap
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
private func createMediaInfoMap(with mediaInfo: MediaInfo) -> [String: Any] {
|
|
397
|
+
var mediaInfoMap : [String: Any] = [:]
|
|
398
|
+
|
|
399
|
+
mediaInfoMap["title"] = mediaInfo.title
|
|
400
|
+
mediaInfoMap["duration"] = Int(mediaInfo.duration ) * 1000
|
|
401
|
+
mediaInfoMap["mediaId"] = mediaInfo.videoId
|
|
402
|
+
mediaInfoMap["description"] = mediaInfo.mediaDescription
|
|
403
|
+
mediaInfoMap["type"] = "info"
|
|
404
|
+
|
|
405
|
+
return mediaInfoMap
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
private func createMediaInfoMap(with asset: VdoAsset) -> [String: Any] {
|
|
409
|
+
var mediaInfoMap : [String: Any] = [:]
|
|
410
|
+
|
|
411
|
+
mediaInfoMap["title"] = asset.title
|
|
412
|
+
mediaInfoMap["duration"] = Int(asset.duration ?? 0) * 1000
|
|
413
|
+
mediaInfoMap["mediaId"] = asset.videoId
|
|
414
|
+
mediaInfoMap["description"] = asset.description
|
|
415
|
+
mediaInfoMap["type"] = "info"
|
|
416
|
+
|
|
417
|
+
return mediaInfoMap
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
private func createVdoAssetMap(with asset: VdoAsset) -> [String: Any] {
|
|
421
|
+
var downloadStatus: [String: Any] = [:]
|
|
422
|
+
|
|
423
|
+
downloadStatus["mediaInfo"] = createMediaInfoMap(with: asset)
|
|
424
|
+
downloadStatus["downloadPercent"] = Int(asset.percentDownload * 100)
|
|
425
|
+
downloadStatus["status"] = self.mapDownloadStateToRNText(downloadState: asset.downloadState)
|
|
426
|
+
downloadStatus["aspectRatio"] = asset.aspectRatio
|
|
427
|
+
if (asset.posters?.isEmpty == false) {
|
|
428
|
+
downloadStatus["poster"] = asset.posters?[0].url ?? ""
|
|
429
|
+
}
|
|
430
|
+
else{
|
|
431
|
+
downloadStatus["poster"] = ""
|
|
432
|
+
}
|
|
433
|
+
return downloadStatus
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
private func createOfflineVdoAssetMap(with downloadInfo: DownloadInfo) -> [String: Any] {
|
|
437
|
+
var downloadStatus: [String: Any] = [:]
|
|
438
|
+
|
|
439
|
+
downloadStatus["mediaInfo"] = createMediaInfoMap(with: downloadInfo.mediaInfo)
|
|
440
|
+
downloadStatus["downloadPercent"] = Int(downloadInfo.percentDownloaded * 100)
|
|
441
|
+
downloadStatus["status"] = self.mapDownloadStateToRNText(downloadState: downloadInfo.status)
|
|
442
|
+
downloadStatus["aspectRatio"] = downloadInfo.aspectRatio
|
|
443
|
+
downloadStatus["poster"] = downloadInfo.poster
|
|
444
|
+
return downloadStatus
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
private func mapDownloadStateToRNText(downloadState: VdoAsset.DownloadState) -> String {
|
|
448
|
+
switch downloadState {
|
|
449
|
+
case .downloaded:
|
|
450
|
+
return "completed"
|
|
451
|
+
case.downloading:
|
|
452
|
+
return "downloading"
|
|
453
|
+
case .notDownloaded:
|
|
454
|
+
return "pending"
|
|
455
|
+
case .paused:
|
|
456
|
+
return "paused"
|
|
457
|
+
@unknown default:
|
|
458
|
+
return "pending"
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
static func saveCustomPlayerIdForMediaId(_ mediaId: String, playerId: String?) {
|
|
463
|
+
let userDefaults: UserDefaults? = UserDefaults.init(suiteName: "com.vdocipher.ios.VdoFramework")
|
|
464
|
+
var downloadedMediaIdPlayerIdMap = userDefaults?.value(forKey: "downloadedMediaIdPlayerIdMap") as? [String: String] ?? [String: String] ()
|
|
465
|
+
if let playerId = playerId {
|
|
466
|
+
downloadedMediaIdPlayerIdMap[mediaId] = playerId
|
|
467
|
+
} else {
|
|
468
|
+
downloadedMediaIdPlayerIdMap.removeValue(forKey: mediaId)
|
|
469
|
+
}
|
|
470
|
+
userDefaults?.set(downloadedMediaIdPlayerIdMap, forKey: "downloadedMediaIdPlayerIdMap")
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
static func getCustomPlayerIdForMediaId(_ mediaId: String) -> String? {
|
|
474
|
+
let userDefaults: UserDefaults? = UserDefaults.init(suiteName: "com.vdocipher.ios.VdoFramework")
|
|
475
|
+
let downloadedMediaIdPlayerIdMap = userDefaults?.value(forKey: "downloadedMediaIdPlayerIdMap") as? [String: String] ?? [String: String] ()
|
|
476
|
+
return downloadedMediaIdPlayerIdMap[mediaId]
|
|
102
477
|
}
|
|
103
478
|
}
|
|
@@ -33,7 +33,6 @@ class EventEmitter {
|
|
|
33
33
|
if let p = params {
|
|
34
34
|
data["nativeEvent"] = p
|
|
35
35
|
}
|
|
36
|
-
// print("event data sent is \(data)")
|
|
37
36
|
EventEmitter.eventEmitter.sendEvent(withName: name.rawValue, body: data)
|
|
38
37
|
}
|
|
39
38
|
}
|
|
@@ -109,7 +108,6 @@ class VdoEventEmitter: RCTEventEmitter {
|
|
|
109
108
|
|
|
110
109
|
override init() {
|
|
111
110
|
super.init()
|
|
112
|
-
// print("\(type(of: self))).\(#function)")
|
|
113
111
|
EventEmitter.sharedInstance.registerEventEmitter(eventEmitter: self)
|
|
114
112
|
}
|
|
115
113
|
|
|
@@ -119,39 +117,32 @@ class VdoEventEmitter: RCTEventEmitter {
|
|
|
119
117
|
///
|
|
120
118
|
/// - Returns: all supported events
|
|
121
119
|
@objc open override func supportedEvents() -> [String] {
|
|
122
|
-
// print("\(type(of: self))).\(#function)")
|
|
123
120
|
return EventEmitter.sharedInstance.allEvents
|
|
124
121
|
}
|
|
125
122
|
|
|
126
123
|
@objc open override func startObserving() {
|
|
127
124
|
super.startObserving()
|
|
128
125
|
hasListener = true
|
|
129
|
-
// print("\(type(of: self))).\(#function)")
|
|
130
126
|
}
|
|
131
127
|
|
|
132
128
|
@objc open override func stopObserving() {
|
|
133
129
|
super.stopObserving()
|
|
134
130
|
hasListener = false
|
|
135
|
-
// print("\(type(of: self))).\(#function)")
|
|
136
131
|
}
|
|
137
132
|
|
|
138
133
|
open override class func requiresMainQueueSetup() -> Bool {
|
|
139
|
-
// print("\(type(of: self))).\(#function)")
|
|
140
134
|
return true
|
|
141
135
|
}
|
|
142
136
|
|
|
143
137
|
open override func addListener(_ eventName: String!) {
|
|
144
138
|
super.addListener(eventName)
|
|
145
|
-
// print("\(type(of: self))).\(#function) eventName: \(eventName)")
|
|
146
139
|
}
|
|
147
140
|
|
|
148
141
|
open override func removeListeners(_ count: Double) {
|
|
149
142
|
super.removeListeners(count)
|
|
150
|
-
// print("\(type(of: self))).\(#function) count: \(count)")
|
|
151
143
|
}
|
|
152
144
|
|
|
153
145
|
open override func invalidate() {
|
|
154
146
|
super.invalidate()
|
|
155
|
-
// print("\(type(of: self))).\(#function)")
|
|
156
147
|
}
|
|
157
148
|
}
|
|
@@ -66,7 +66,12 @@ RCT_EXTERN_METHOD(supportedEvents)
|
|
|
66
66
|
@interface RCT_EXTERN_MODULE(VdoDownload, RCTEventEmitter)
|
|
67
67
|
|
|
68
68
|
RCT_EXTERN_METHOD(supportedEvents)
|
|
69
|
-
|
|
69
|
+
RCT_EXTERN_METHOD(query: (NSDictionary *) queryFilters errorCallback: (RCTResponseSenderBlock) errorCallback successCallback: (RCTResponseSenderBlock) successCallback)
|
|
70
|
+
RCT_EXTERN_METHOD(getDownloadOptions: (NSDictionary *) optionParams errorCallback: (RCTResponseSenderBlock) errorCallback successCallback: (RCTResponseSenderBlock) successCallback)
|
|
71
|
+
RCT_EXTERN_METHOD(enqueueDownload: (NSString *) nativeId requestOptions: (NSDictionary *) requestOptions errorCallback: (RCTResponseSenderBlock) errorCallback successCallback: (RCTResponseSenderBlock) successCallback)
|
|
72
|
+
RCT_EXTERN_METHOD(remove: (NSArray *) mediaIds errorCallback: (RCTResponseSenderBlock) errorCallback successCallback: (RCTResponseSenderBlock) successCallback)
|
|
73
|
+
RCT_EXTERN_METHOD(stop: (NSArray *) mediaId errorCallback: (RCTResponseSenderBlock) errorCallback successCallback: (RCTResponseSenderBlock) successCallback)
|
|
74
|
+
RCT_EXTERN_METHOD(resume: (NSArray *) mediaId errorCallback: (RCTResponseSenderBlock) errorCallback successCallback: (RCTResponseSenderBlock) successCallback)
|
|
70
75
|
@end
|
|
71
76
|
|
|
72
77
|
@interface RCT_EXTERN_MODULE(VdoPlayer, NSObject)
|
|
@@ -97,3 +102,5 @@ RCT_EXTERN_METHOD(getDuration: (RCTResponseSenderBlock) callback)
|
|
|
97
102
|
}
|
|
98
103
|
|
|
99
104
|
@end
|
|
105
|
+
|
|
106
|
+
|
|
@@ -5,7 +5,7 @@ import VdoFramework
|
|
|
5
5
|
@objc(VdocipherRnBridge)
|
|
6
6
|
class VdocipherRnBridge: RCTViewManager {
|
|
7
7
|
|
|
8
|
-
static let vdocipherRnBridgeVersionString = "1.17.
|
|
8
|
+
static let vdocipherRnBridgeVersionString = "1.17.2"
|
|
9
9
|
|
|
10
10
|
@objc override static func requiresMainQueueSetup() -> Bool {
|
|
11
11
|
return true
|
|
@@ -14,7 +14,6 @@ class VdocipherRnBridge: RCTViewManager {
|
|
|
14
14
|
private var playerViewController: AVPlayerViewController?
|
|
15
15
|
|
|
16
16
|
@objc func startVideoScreen(_ embedInfo: [String: Any], setPictureInPictureSupport: Bool) {
|
|
17
|
-
// print("REACT LOG ===== start Video Screen Function called from React side.... \(embedInfo)")
|
|
18
17
|
let userDefaults: UserDefaults? = UserDefaults.init(suiteName: "com.vdocipher.ios.rn.VdoFramework")
|
|
19
18
|
userDefaults?.set(["name": "react-native", "version": VdocipherRnBridge.vdocipherRnBridgeVersionString], forKey: "rnToolkitInfo")
|
|
20
19
|
DispatchQueue.main.async {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vdocipher-rn-bridge",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.2",
|
|
4
4
|
"description": "React native bridge library that delegates to vdocipher native android SDK",
|
|
5
5
|
"homepage": "https://www.vdocipher.com/docs/mobile/react-native/getting-started/",
|
|
6
6
|
"scripts": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"author": "",
|
|
13
13
|
"license": "",
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"react-native": "0.68 - 0.
|
|
15
|
+
"react-native": "0.68 - 0.72.4"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"deprecated-react-native-prop-types": "^2.3.0",
|
|
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
18
|
|
|
19
19
|
s.dependency "React-Core"
|
|
20
|
-
s.dependency "VdoFramework", "2.
|
|
20
|
+
s.dependency "VdoFramework", "2.5.1"
|
|
21
21
|
|
|
22
22
|
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
23
23
|
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
package/CHANGELOG.md
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
## Changelog
|
|
2
|
-
### 1.17.0
|
|
3
|
-
* Added support for iOS with native iOS sdk version as 2.4.3
|
|
4
|
-
* Updated VdoCipher Android SDK dependency to 1.22.1.
|
|
5
|
-
* Added option to pause and resume downloads.
|
|
6
|
-
* Bug fixes:
|
|
7
|
-
* minHeight getting overridden by sdk.
|
|
8
|
-
* NullPointerException when downloading using invalid params.
|
|
9
|
-
* IllegalStateException when opening new screen from player screen and coming back.
|
|
10
|
-
* NullPointerException on some devices when going fullscreen by using prop method in PlayerUI.
|
|
11
|
-
* ForegroundServiceStartNotAllowedException coming in Android 12 and above.
|
|
12
|
-
|
|
13
|
-
### 1.16.0
|
|
14
|
-
* Updated VdoCipher Android SDK dependency to 1.21.0.
|
|
15
|
-
* Added support for `windowLayoutInDisplayCutoutMode` with inbuilt player UI.
|
|
16
|
-
* Improved feedback of double tap to skip forward and backward.
|
|
17
|
-
* Fullscreen Changes for Player UI:
|
|
18
|
-
* Fixed auto rotate lock while going into fullscreen mode.
|
|
19
|
-
* Implemented fullscreen behavior based on aspect ratio:
|
|
20
|
-
* Vertical videos will go fullscreen in portrait mode.
|
|
21
|
-
* Horizontal videos will go fullscreen in landscape mode.
|
|
22
|
-
* Deprecated `enterFullscreen` and `exitFullscreen` APIs.
|
|
23
|
-
* Added `enterFullscreenV2` and `exitFullscreenV2` APIs with aspect ratio-based fullscreen rotation.
|
|
24
|
-
* Fullscreen Changes for Player with Custom Controls:
|
|
25
|
-
* Deprecated `enterFullscreen` and `exitFullscreen` APIs.
|
|
26
|
-
* Removed the option to go back to portrait mode when the back button is pressed while in fullscreen mode.
|
|
27
|
-
* Fullscreen-related changes need to be performed manually.
|
|
28
|
-
|
|
29
|
-
### 1.15.0
|
|
30
|
-
* Updated VdoCipher android sdk dependency to 1.19.6
|
|
31
|
-
* Added PlayerUI for fullscreen player
|
|
32
|
-
* Added PIP support for fullscreen player
|
|
33
|
-
* Added range for react-native peer dependency
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
### 1.14.0
|
|
37
|
-
* Added `getPlaybackPropertiesV2` method to get totalPlayed and totalCovered properties
|
|
38
|
-
* Added track selection APIs for Player UI
|
|
39
|
-
|
|
40
|
-
### 1.13.2
|
|
41
|
-
* Updated VdoCipher android sdk dependency to 1.19.4
|
|
42
|
-
* Updated playerConfig to customPlayer Id
|
|
43
|
-
* Added customPlayerId for Downloads
|
|
44
|
-
* Bug fix
|
|
45
|
-
|
|
46
|
-
### 1.13.1
|
|
47
|
-
* Added resizeMode attribute in style prop
|
|
48
|
-
|
|
49
|
-
### 1.13.0
|
|
50
|
-
* Updated VdoCipher android sdk dependency to 1.19.3
|
|
51
|
-
* Added support for setting aspect ratio and resize mode
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
### 1.12.3
|
|
55
|
-
* Adding typescript support
|
|
56
|
-
|
|
57
|
-
### 1.12.2
|
|
58
|
-
* Bug fix
|
|
59
|
-
|
|
60
|
-
### 1.12.1
|
|
61
|
-
* Adding support of pip in separate activity
|
|
62
|
-
|
|
63
|
-
### 1.12.0
|
|
64
|
-
* Updated VdoCipher android sdk dependency to 1.19.1
|
|
65
|
-
* Added track selection APIs
|
|
66
|
-
|
|
67
|
-
### 1.11.0
|
|
68
|
-
* Updated VdoCipher android sdk dependency to 1.19.0
|
|
69
|
-
|
|
70
|
-
### 1.10.2
|
|
71
|
-
* Updated VdoCipher android sdk dependency to 1.18.2
|
|
72
|
-
* Updated compileSdkVersion to 33 and targetSdkVersion to 32
|
|
73
|
-
|
|
74
|
-
### 1.10.1
|
|
75
|
-
* Updated VdoCipher android sdk dependency to 1.18.1
|
|
76
|
-
* Updated player with built-in controls to use Player-UI provided by native sdk
|
|
77
|
-
- The controls on this player can be managed using video dashboard
|
|
78
|
-
- All the controls like save offline, caption search, pip, etc which are present in Player-UI will be available in this player
|
|
79
|
-
- Player-UI is supported on tv only when using react-native-tvos library
|
|
80
|
-
* Added support for PIP
|
|
81
|
-
* Added support for setting preferred captions language
|
|
82
|
-
* Added support for safetynet
|
|
83
|
-
* Updated download implementation to use download feature provided by exoplayer
|
|
84
|
-
* Added support for react-native version 0.70
|
|
85
|
-
* Bug fixes
|
|
86
|
-
|
|
87
|
-
### 1.9.2
|
|
88
|
-
* Migrating from jcenter to mavenCentral
|
|
89
|
-
|
|
90
|
-
### 1.9.1
|
|
91
|
-
* Bug Fixes
|
|
92
|
-
|
|
93
|
-
### 1.9.0
|
|
94
|
-
* Added support for auto resume
|
|
95
|
-
* Bug fixes
|
|
96
|
-
|
|
97
|
-
### 1.8.1
|
|
98
|
-
* Update VdoCipher android sdk dependency to 1.10.1
|
|
99
|
-
|
|
100
|
-
### 1.8.0
|
|
101
|
-
* Update VdoCipher android sdk dependency to 1.10.0
|
|
102
|
-
* Fixed release build errors
|
|
103
|
-
* Bug fixes
|
|
104
|
-
|
|
105
|
-
### 1.7.3
|
|
106
|
-
* Update VdoCipher android sdk dependency to 1.8.1
|
|
107
|
-
* Added adb debugging restrictions opt-in
|
|
108
|
-
|
|
109
|
-
### 1.7.2
|
|
110
|
-
* Update VdoCipher android sdk dependency to 1.7.3
|
|
111
|
-
* Fixed error message for OTP related errors which cannot be re-tried with same embedInfo
|
|
112
|
-
* Bug fixes
|
|
113
|
-
|
|
114
|
-
### 1.7.1
|
|
115
|
-
* Update VdoCipher android sdk dependency to 1.7.1
|
|
116
|
-
* Bug fixes
|
|
117
|
-
|
|
118
|
-
### 1.7.0
|
|
119
|
-
* Add api to obtain additional playback properties
|
|
120
|
-
* Update VdoCipher android sdk dependency to 1.5.1
|
|
121
|
-
|
|
122
|
-
### 1.6.0
|
|
123
|
-
* Add support to force lowest or highest supported bitrate, cap video bitrate, set buffering goal
|
|
124
|
-
* Add playback speed api
|
|
125
|
-
* Update VdoCipher android sdk dependency to 1.4.0
|
|
126
|
-
|
|
127
|
-
### 1.5.3
|
|
128
|
-
* Fix startVideoScreen implementation to support embedInfo for offline playback
|
|
129
|
-
|
|
130
|
-
### 1.5.2
|
|
131
|
-
* Update VdoCipher android sdk dependency to 1.3.3
|
|
132
|
-
* Bug fixes
|
|
133
|
-
|
|
134
|
-
### 1.5.1
|
|
135
|
-
* Add downloads api
|
|
136
|
-
* Update native controls to show quality toggle button
|
|
137
|
-
* Update VdoCipher android sdk dependency to 1.3.2
|
|
138
|
-
|
|
139
|
-
### 1.4.0
|
|
140
|
-
* Add JS fullscreen api
|
|
141
|
-
* Update VdoCipher android sdk dependency to 1.3.1
|
|
142
|
-
|
|
143
|
-
### 1.3.2
|
|
144
|
-
* Enable fullscreen controls in native embedded controls
|
|
145
|
-
|
|
146
|
-
### 1.3.1
|
|
147
|
-
* Fix android manifest merger bug
|
|
148
|
-
* Update VdoCipher android sdk dependency to 1.2.1
|
|
149
|
-
|
|
150
|
-
### 1.3.0
|
|
151
|
-
* Fix video launch in standalone android activity
|
|
152
|
-
* Keep screen on when video is active
|
|
153
|
-
* Upgrade react-native to 0.61.4
|
package/android/src/.DS_Store
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/ios/.DS_Store
DELETED
|
Binary file
|