Skip to content

Commit

Permalink
Merge pull request #250 from bitmovin/fix-non-drm-playback-on-iOS
Browse files Browse the repository at this point in the history
Fix non-DRM playback on iOS
  • Loading branch information
rolandkakonyi authored Sep 19, 2023
2 parents 51d96d7 + 546400b commit 4dae06e
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions ios/SourceModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@ class SourceModule: NSObject, RCTBridgeModule {
@objc(initWithAnalyticsConfig:drmNativeId:config:analyticsSourceMetadata:)
func initWithAnalyticsConfig(_ nativeId: NativeId, drmNativeId: NativeId?, config: Any?, analyticsSourceMetadata: Any?) {
bridge.uiManager.addUIBlock { [weak self] _, _ in
let fairplayConfig = drmNativeId != nil ? self?.getDrmModule()?.retrieve(drmNativeId!) : nil

let fairplayConfig: FairplayConfig?
if let drmNativeId = drmNativeId {
fairplayConfig = self?.getDrmModule()?.retrieve(drmNativeId)
} else {
fairplayConfig = nil
}

guard
self?.sources[nativeId] == nil,
let sourceConfig = RCTConvert.sourceConfig(config, drmConfig: fairplayConfig),
Expand All @@ -64,9 +69,15 @@ class SourceModule: NSObject, RCTBridgeModule {
@objc(initWithConfig:drmNativeId:config:)
func initWithConfig(_ nativeId: NativeId, drmNativeId: NativeId?, config: Any?) {
bridge.uiManager.addUIBlock { [weak self] _, _ in
let fairplayConfig: FairplayConfig?
if let drmNativeId = drmNativeId {
fairplayConfig = self?.getDrmModule()?.retrieve(drmNativeId)
} else {
fairplayConfig = nil
}

guard
self?.sources[nativeId] == nil,
let fairplayConfig = drmNativeId != nil ? self?.getDrmModule()?.retrieve(drmNativeId!) : nil,
let sourceConfig = RCTConvert.sourceConfig(config, drmConfig: fairplayConfig)
else {
return
Expand Down

0 comments on commit 4dae06e

Please sign in to comment.