FAQ: How do I handle lock screen controls with multiple players?

Answer: Use the displayLockScreenControls property on the JWPlayerController.


Background

A player defaults to displaying lock screen controls when it is instantiated. In a multiple-player scenario, a newly instantiated player takes over the lock screen controls and takes over the title of the lock screen.


Solution

To address this issue, use the displayLockScreenControls property on the JWPlayerController.

  1. After all players have been instantiated, set displayLockScreenControls = false for all players that should not have lock screen controls.
  2. Set displayLockScreenControls = true for the player that should have lock screen controls.
// Disable the newly instantiated player's lock screen controls.
newPlayer.displayLockScreenControls = false

// Reset the desired player's lock screen controls.
desiredPlayer.displayLockScreenControls = true
// Disable the newly instantiated player's lock screen controls.
newPlayer.displayLockScreenControls = NO;

// Reset the desired player's lock screen controls.
desiredPlayer.displayLockScreenControls = YES;


Did this page help you?