You.i Engine
CYIWidevineModularCustomRequestDRMConfiguration Class Reference

Detailed Description

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.
Note
All configurations should be set before calling CYIAbstractVideoPlayer::Prepare to ensure that they will be properly picked up by the player.

#include <player/YiWidevineModularCustomRequestDRMConfiguration.h>

Inheritance diagram for CYIWidevineModularCustomRequestDRMConfiguration:

Public Member Functions

 CYIWidevineModularCustomRequestDRMConfiguration ()=default
 
 CYIWidevineModularCustomRequestDRMConfiguration (const CYIUrl &licenseAcquisitionUrl)
 
virtual CYIAbstractVideoPlayer::DRMScheme GetScheme () const final override
 
- Public Member Functions inherited from CYILicenseAcquisitionDRMConfiguration
 CYILicenseAcquisitionDRMConfiguration ()=default
 
 CYILicenseAcquisitionDRMConfiguration (const CYIUrl &licenseAcquisitionUrl)
 
virtual ~CYILicenseAcquisitionDRMConfiguration ()
 
void SetLicenseAcquisitionUrl (const CYIUrl &licenseAcquisitionUrl)
 
const CYIUrlGetLicenseAcquisitionUrl () const
 
void SetLicenseAcquisitionHeader (const CYIString &headerField, const CYIString headerValue)
 
void ClearLicenseAcquisitionHeader (const CYIString &headerField)
 
void ClearLicenseAcquisitionHeaders ()
 
const std::map< CYIString, CYIString > & GetLicenseAcquisitionHeaders () const
 
- Public Member Functions inherited from CYIAbstractVideoPlayer::DRMConfiguration
virtual ~DRMConfiguration ()=default
 

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

- Protected Attributes inherited from CYILicenseAcquisitionDRMConfiguration
CYIUrl m_licenseAcquisitionUrl
 
std::map< CYIString, CYIStringm_licenseAcquisitionHeaders
 

Constructor & Destructor Documentation

◆ CYIWidevineModularCustomRequestDRMConfiguration() [1/2]

CYIWidevineModularCustomRequestDRMConfiguration::CYIWidevineModularCustomRequestDRMConfiguration ( )
default

Constructs a default instance. The license URL contained within the media will be used, unless explicitly set.

See also
CYILicenseAcquisitionDRMConfiguration::SetLicenseAcquisitionUrl

◆ CYIWidevineModularCustomRequestDRMConfiguration() [2/2]

CYIWidevineModularCustomRequestDRMConfiguration::CYIWidevineModularCustomRequestDRMConfiguration ( const CYIUrl licenseAcquisitionUrl)

Constructs an instance containing the specified licenseAcquisitionUrl.

See also
CYILicenseAcquisitionDRMConfiguration::SetLicenseAcquisitionUrl

Member Function Documentation

◆ GetScheme()

virtual CYIAbstractVideoPlayer::DRMScheme CYIWidevineModularCustomRequestDRMConfiguration::GetScheme ( ) const
finaloverridevirtual

Returns the DRM scheme which this configuration is associated with.

Implements CYIAbstractVideoPlayer::DRMConfiguration.

Member Data Documentation

◆ DRMPostRequestAvailable

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.

◆ NotifyFailure

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.

◆ NotifySuccess

CYISignal<const std::vector<char> & > CYIWidevineModularCustomRequestDRMConfiguration::NotifySuccess

Application must emit this signal to provide the successfuly fetched license data to the player.


The documentation for this class was generated from the following file: