JWLockScreenManager
@objcMembers
public class JWLockScreenManager : NSObject
JWLockScreenManager allows setting the active JWPlayer that will be shown on the NowPlaying Controls.
Important
In your App´s Signing & Capabilities you should add Background Modes:- Audio.
- AirPlay.
- and Picture in Picture. ### Notes: In order for the lock screen controls to be visible:
- Background audio must be enabled.
- The audio session must be set to
AVAudioSessionCategoryPlayback
.
By default when using more than one player, the last player played will have priority on NowPlaying Controls.
-
A shared instance of the JWLockScreenController.
Declaration
Swift
public static let shared: JWLockScreenManager
-
The active player to be synchronized with the NowPlaying Controls.
Precondition
If this player is set to nil then the lockscreen will be disabled.Declaration
Swift
public func activeLockScreenPlayer(_ player: JWPlayer)
Parameters
player
JWPlayer object to be synchronized with NowPlaying Controls.
-
Removes the player if it’s the same that was being tracked for NowPlaying Controls.
Declaration
Swift
public func removePlayer(_ player: JWPlayer)
Parameters
player
JWPlayer object that might been tracked.