Skip to content

Commit

Permalink
feat(minTimeshiftBufferDepth): add LiveConfig serializers on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
123mpozzi committed Oct 23, 2023
1 parent e5af624 commit 2356bdc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions ios/RCTConvert+BitmovinPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ extension RCTConvert {
if let bufferConfig = RCTConvert.bufferConfig(json["bufferConfig"]) {
playerConfig.bufferConfig = bufferConfig
}
if let liveConfig = RCTConvert.liveConfig(json["liveConfig"]) {
playerConfig.liveConfig = liveConfig
}
#if os(iOS)
if let remoteControlConfig = RCTConvert.remoteControlConfig(json["remoteControlConfig"]) {
playerConfig.remoteControlConfig = remoteControlConfig
Expand Down Expand Up @@ -191,6 +194,22 @@ extension RCTConvert {
return bufferConfig
}

/**
Utility method to instantiate a `LiveConfig` from a JS object.
- Parameter json: JS object.
- Returns: The produced `LiveConfig` object, or `nil` if `json` is not valid.
*/
static func liveConfig(_ json: Any?) -> LiveConfig? {
guard let json = json as? [String: Any?] else {
return nil
}
let liveConfig = LiveConfig()
if let minTimeshiftBufferDepth = json["minTimeshiftBufferDepth"] as? NSNumber {
liveConfig.minTimeshiftBufferDepth = minTimeshiftBufferDepth.doubleValue
}
return liveConfig
}

/**
Utility method to instantiate an `AdvertisingConfig` from a JS object.
- Parameter json: JS object.
Expand Down

0 comments on commit 2356bdc

Please sign in to comment.