Skip to content

Commit

Permalink
restart player when example menu options change
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjl-mux committed May 21, 2024
1 parent 0c5631c commit c6dd0fb
Showing 1 changed file with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,31 @@ class SmartCacheExampleViewController: UIViewController {
ProcessInfo.processInfo.playbackID ?? "qxb01i6T202018GFS02vp9RIe01icTcDCjVzQpmaB00CUisJ4"
}

var smartCacheEnabled: Bool = true
var singleRenditionResolutionTier: SingleRenditionResolutionTier = .only720p
var smartCacheEnabled: Bool = true {
didSet {
playerViewController.prepare(
playbackID: playbackID,
playbackOptions: PlaybackOptions(
enableSmartCache: smartCacheEnabled,
singleRenditionResolutionTier: singleRenditionResolutionTier
),
monitoringOptions: monitoringOptions
)
}
}

var singleRenditionResolutionTier: SingleRenditionResolutionTier = .only720p {
didSet {
playerViewController.prepare(
playbackID: playbackID,
playbackOptions: PlaybackOptions(
enableSmartCache: smartCacheEnabled,
singleRenditionResolutionTier: singleRenditionResolutionTier
),
monitoringOptions: monitoringOptions
)
}
}

// MARK: Status Bar Appearance

Expand Down

0 comments on commit c6dd0fb

Please sign in to comment.