Secure Session Management
The Secure Session Manager (SSM) service integrates with the SSP license server and limits simultaneous encrypted playback.
When the client device starts an encrypted playback, the CONNECT Player SDK requests a session token from the SSM server. The session token is used as part of the license request, and the SDK keeps a heartbeat with the SSM server to maintain the SSM session. The SDK tears down the SSM session when the playback stops.
If the request for a session token fails (potentially due to too many existing playback sessions), the license request will fail, and playback can not continue.
Example code
As with standard encrypted playback with SSP, an OTVSSPLicenseDelegate
is created to handle the requests with SSP with the SSM service.
The OTVSSPLicenseDelegate
initialiser takes two optional parameters that configure the SSM functionality:
OTVSSPLiceseDelegate.init(certificateURL:licenseURL:ssmServerURL:syncSSMSetupTeardown:)
ssmServerURL
is the URL to the SSM servicesyncSSMSetupTeardown
specifies whether network requests to set up and teardown the SSM session are made synchronously or not. SettingsyncSSMSetupTeardown
to true blocks the main thread while the network requests are being made.
If the OTVSSPLicenseDelegate
is initialised with ssmServerURL, every playback will have an SSM session. When the playback stopped, the player will release the session when OTVAVPlayerItem
is de-initialised.
Error handling
When SSM errors occur, the player posts the following notifications:
OTVSSMSetupErrorNotification
OTVSSMTeardownErrorNotification
OTVSSMHeartbeatErrorNotification
The player should not continue playback once any of these notifications are received. The notification userInfo
contains information on any HTTP error codes and SSM error messages.
Background SSM behaviour
When the application goes to the background, the SSM service will behave in the following ways:
- Normal background mode
When the application returns to the foreground, if no error notification is received, playback can resume. If anOTVSSMHeartbeatErrorNotification
is received, the application should stop playback and attempt to zap to the same stream to resume playback securely. - Picture-in-picture mode
When PIP is enabled and the application goes to the background, the SSM service works as normal.