A class containing the necessary configurations for playback of Widevine Modular protected media, and with the oppurtunity available to handle all network requests required for license acquisition.
This class is provided to CYIAbstractVideoPlayer at prepare time of Widevine with custom license acquisition requests.
There are two personas considered by this class, the user of the CYIAbstractVideoPlayer and the implementer of a concrete CYIAbstractVideoPlayer.
Flow from the perspective of a user of the CYIAbstractVideoPlayer:
1. Provide the CYIAbstractVideoPlayer with a CYIWidevineModularCustomRequestDRMConfiguration instance when calling CYIAbstractVideoPlayer::Prepare. 2. When the POST request information is available, the player will emit DRMPostRequestAvailable with the POST request information. 3. Use the POST request information, making any necessary modifications, to handle all license acquisition network calls required to get the license data. 4. When the license data has been obtained it must be provided to the player by emitting NotifySuccess. Once the license data has been provided to the player the player will be ready to play the DRM protected media. NotifyFailure must be emitted if an error occurs any time after DRMPostRequestAvailable has been emitted by the player, and before NotifySuccess has been emitted by the application code, to notify the player of the error and stop the DRM request. If there is an issue during the above flow the CYIAbstractVideoPlayer will emit CYIAbstractVideoPlayer::NotifyErrorOccurred with a DRM error.
Flow from the perspective of an implementer of a concrete CYIAbstractVideoPlayer:
1. The CYIWidevineModularCustomRequestDRMConfiguration will be available to the player implementation by the time CYIAbstractVideoPlayer::_Prepare is called. 2. The player implementation must connect to NotifyFailure and handle any cleanup that is required when NotifyFailure has been emitted. 3. The player implementation must connect to NotifySuccess and handle passing the received license data into the native player implementation for DRM playabck. 4. The player implementation must emit DRMPostRequestAvailable with the POST request information when it is available from the native player implementation. The player implementation should not start another custom license request by emitting DRMPostRequestAvailable again, until it has handled either NotifyFailure or NotifySuccess, to indicate that the first license request is finished.
#include <player/YiWidevineModularCustomRequestDRMConfiguration.h>
Public Attributes | |
CYISignal< const CYIString &, const std::vector< char > &, const std::vector< std::pair< CYIString, CYIString > > &> | DRMPostRequestAvailable |
CYISignal< const std::vector< char > &> | NotifySuccess |
CYISignal | NotifyFailure |
Additional Inherited Members | |
![]() | |
CYIUrl | m_licenseAcquisitionUrl |
std::map< CYIString, CYIString > | m_licenseAcquisitionHeaders |
|
default |
Constructs a default instance. The license URL contained within the media will be used, unless explicitly set.
CYIWidevineModularCustomRequestDRMConfiguration::CYIWidevineModularCustomRequestDRMConfiguration | ( | const CYIUrl & | licenseAcquisitionUrl | ) |
Constructs an instance containing the specified licenseAcquisitionUrl.
|
finaloverridevirtual |
Returns the DRM scheme which this configuration is associated with.
Implements CYIAbstractVideoPlayer::DRMConfiguration.
CYISignal<const CYIString & , const std::vector<char> & , const std::vector<std::pair<CYIString, CYIString> > & > CYIWidevineModularCustomRequestDRMConfiguration::DRMPostRequestAvailable |
Emitted by the player immediately before the native player would make a license acquisition POST request, in order to give application side code the oppurtunity to handle the POST request. Contains all information required to make a POST request.
CYISignal CYIWidevineModularCustomRequestDRMConfiguration::NotifyFailure |
Application must emit this signal to notify the player that an error has occured during the DRM flow. This signal must be emitted any time an error occurs after DRMRequestUrlAvailable has been emitted by the player, and before NotifySuccess has been emitted by the application code.
CYISignal<const std::vector<char> & > CYIWidevineModularCustomRequestDRMConfiguration::NotifySuccess |
Application must emit this signal to provide the successfuly fetched license data to the player.