Skip to content

Commit

Permalink
Enable media controls by default
Browse files Browse the repository at this point in the history
- NowPlaying info for iOS
- MediaSessions for Android
  • Loading branch information
123mpozzi committed Nov 5, 2024
1 parent fe1e651 commit 72f68f1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class PlayerModule(context: ReactApplicationContext) : BitmovinBaseModule(contex
val analyticsConfig = analyticsConfigJson?.toAnalyticsConfig()
val defaultMetadata = analyticsConfigJson?.getMap("defaultMetadata")?.toAnalyticsDefaultMetadata()
val enableMediaSession = playerConfigJson?.getMap("mediaControlConfig")
?.toMediaControlConfig()?.isEnabled ?: false
?.toMediaControlConfig()?.isEnabled ?: true

val networkConfig = networkNativeId?.let { networkModule.getConfig(it) }
if (networkConfig != null) {
Expand Down
5 changes: 3 additions & 2 deletions ios/RCTConvert+BitmovinPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1333,10 +1333,11 @@ extension RCTConvert {
}

static func mediaControlConfig(_ json: Any?) -> NowPlayingConfig? {
let nowPlayingConfig = NowPlayingConfig()
guard let json = json as? [String: Any?] else {
return nil
nowPlayingConfig.isNowPlayingInfoEnabled = true
return nowPlayingConfig
}
let nowPlayingConfig = NowPlayingConfig()
if let isEnabled = json["isEnabled"] as? Bool {
nowPlayingConfig.isNowPlayingInfoEnabled = isEnabled
}
Expand Down
2 changes: 1 addition & 1 deletion src/mediaControlConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface MediaControlConfig {
* Enable the default behavior of displaying media information
* on the lock screen, in notifications, and within the control center.
*
* Default is `false`.
* Default is `true`.
*
* For a detailed list of the supported features in the **default behavior**,
* check the **Default Supported Features** section.
Expand Down

0 comments on commit 72f68f1

Please sign in to comment.