An abstract video player that provides a basic interface that all subclasses must implement.
The abstract video player provides all the basic functionality expected of a standard video player. This video player must be subclassed and implemented in a concrete way. Basic player functionality and signals are provided by the abstract video player. The abstract video player contains a CYIVideoPlayerStateManager which is responsible for maintaining valid player states for the abstract video player. When implementing a concrete player state transitions must be made through the CYIVideoPlayerStateManager. See the class level documentation of CYIVideoPlayerStateManager for further detail on state transitions in the video player.
CYIDefaultVideoPlayerFactory is provided to construct the default concrete player for the current platform.
CYIAbstractVideoPlayer and each provided concrete implementation is equipped with RTTI. This enables dynamic casting to a concrete player in order to safely use APIs specific to the desired player. It is recommended to use the CYIAbstractVideoPlayer type whenever possible. For example:
#include <player/YiAbstractVideoPlayer.h>
Classes | |
class | AdaptiveResolutionInterface |
An interface to adjust playback quality through resolution. More... | |
struct | AudioTrackInfo |
class | BackgroundPlaybackInterface |
class | BufferingInterface |
struct | BufferLength |
struct | ClosedCaptionsTrackInfo |
class | DRMConfiguration |
The base class for all DRM configurations. More... | |
struct | Error |
class | HeadphoneJackInterface |
class | LiveSessionInterface |
An interface to adjust playback of live streams. More... | |
class | MediaPlaybackControlsInterface |
class | NetworkTimeoutInterface |
struct | PlayerState |
struct | SeekableRange |
struct | Statistics |
struct | TimedMetadata |
struct | TimedMetadataAdditionalDataKeys |
class | TimedMetadataInterface |
struct | TrackInfo |
class | VideoRequestHTTPHeadersInterface |
Public Types | |
enum | MediaState { MediaState::Unloaded, MediaState::Preparing, MediaState::Ready } |
enum | PlaybackState { PlaybackState::Playing, PlaybackState::Paused, PlaybackState::Buffering } |
enum | StreamingFormat { StreamingFormat::HLS = 0, StreamingFormat::Smooth, StreamingFormat::DASH, StreamingFormat::MP4 } |
enum | DRMScheme { DRMScheme::None = 0, DRMScheme::FairPlay, DRMScheme::PlayReady, DRMScheme::WidevineModular, DRMScheme::WidevineModularCustomRequest } |
enum | ErrorCode { ErrorCode::PlaybackError, ErrorCode::UnsupportedFormat, ErrorCode::StateTransitionError, ErrorCode::DRMError, ErrorCode::InitializationError, ErrorCode::Unknown } |
using | RTTIInstantiatability = CYIRuntimeTypeInfo::NonInstantiableTag |
using | RefreshDRMConfigurationCallback = std::function< std::unique_ptr< CYIAbstractVideoPlayer::DRMConfiguration >(std::unique_ptr< CYIAbstractVideoPlayer::DRMConfiguration >)> |
Public Attributes | |
CYISignal< std::shared_ptr< CYIPlatformPlayerHandle >, std::shared_ptr< CYIPlatformPlayerHandle > > | PlatformPlayerHandleChanged |
CYISignal< std::shared_ptr< CYIPlatformViewHandle >, std::shared_ptr< CYIPlatformViewHandle > > | PlatformPlayerContainerViewHandleChanged |
CYISignal | BufferingStarted |
CYISignal | BufferingEnded |
CYISignal< Error > | ErrorOccurred |
CYISignal | Preparing |
CYISignal | Ready |
CYISignal | Playing |
CYISignal | Paused |
CYISignal | PlaybackComplete |
CYISignal | Finalized |
CYISignal< uint64_t > | CurrentTimeUpdated |
CYISignal< uint64_t > | DurationChanged |
CYISignal< bool, uint64_t > | SeekCompleted |
CYISignal< const CYIAbstractVideoPlayer::PlayerState & > | PlayerStateChanged |
CYISignal< std::vector< AudioTrackInfo > > | AvailableAudioTracksChanged |
CYISignal< std::vector< ClosedCaptionsTrackInfo > > | AvailableClosedCaptionsTracksChanged |
CYISignal< float > | TotalBitrateChanged |
CYISignal< float > | VideoBitrateChanged |
CYISignal< float > | AudioBitrateChanged |
Protected Attributes | |
CYISignal< Error > | NotifyErrorOccurred |
CYISignal | NotifyPlaybackComplete |
CYISignal< uint64_t > | NotifyDurationChanged |
CYISignal< bool, uint64_t > | NotifySeekCompleted |
std::unique_ptr< CYIVideoPlayerStateManager > | m_pStateManager |
std::unique_ptr< CYIClosedCaptionsDispatcher > | m_pClosedCaptionsDispatcher |
std::unique_ptr< CYIClosedCaptionsStyleManager > | m_pStyleManager |
std::unique_ptr< DRMConfiguration > | m_pDRMConfiguration |
uint64_t | m_maxBitrate |
uint64_t | m_initialBandwidthHint |
uint64_t | m_initialStartTimeMs |
RefreshDRMConfigurationCallback | m_refreshDRMConfigurationCallback |
Friends | |
class | CYIVideoPlayerStateManager |
using CYIAbstractVideoPlayer::RefreshDRMConfigurationCallback = std::function<std::unique_ptr<CYIAbstractVideoPlayer::DRMConfiguration>(std::unique_ptr<CYIAbstractVideoPlayer::DRMConfiguration>)> |
Sets the callback for refreshing the DRM configuration. This will be called by the player when a new DRM key is needed. The callback allows the user to modify the DRM configuration, if needed. The argument is the current configuration. It must return a valid configuration. If no changes are required, the callback should return the argument that it received.
using CYIAbstractVideoPlayer::RTTIInstantiatability = CYIRuntimeTypeInfo::NonInstantiableTag |
|
strong |
Enumeration of available DRM schemes.
Enumerator | |
---|---|
None | |
FairPlay | |
PlayReady | |
WidevineModular | |
WidevineModularCustomRequest |
|
strong |
Enumeration of the possible errors which the player can emit.
Enumerator | |
---|---|
PlaybackError | Indicates that an error occurred during playback of the video media. This may occur at anytime which the media state is not CYIAbstractVideoPlayer::MediaState::Unloaded. |
UnsupportedFormat | Indicates that the combination of formatHint and pDRMConfiguration provided to Prepare() is not supported by the current player/platform. |
StateTransitionError | Indicates that the player has transitioned into an invalid state.
|
DRMError | Indicates that an error occurred when attempting to process DRM protected content. |
InitializationError | Indicates that there was an error when initializing the player. |
Unknown | Indicates that an unknown error has occurred in the player. |
|
strong |
Enumeration of the states relating to the preparation of media for the video player.
Enumerator | |
---|---|
Unloaded | Represents that no video media is currently loaded into the player for playback. This is the default media state for the player.
|
Preparing | Represents that the video media has been provided to the player and is in the process of being loaded for playback. |
Ready | Represents that the video media is loaded into the player and ready for playback. When the player is in this state the player will also have a valid CYIAbstractVideoPlayer::PlaybackState.
|
|
strong |
Enumeration of the states relating to the current media playback state for the video player. These states are only relevant when the player's media state is CYIAbstractVideoPlayer::MediaState::Ready.
|
strong |
Enumeration of available video media streaming formats.
Enumerator | |
---|---|
HLS | |
Smooth | |
DASH | |
MP4 |
|
virtual |
|
protected |
bool CYIAbstractVideoPlayer::AreAudioTracksAvailable | ( | ) | const |
Returns true if the audio tracks for the current media have been loaded. Returns false if the tracks are currently unavailable.
bool CYIAbstractVideoPlayer::AreClosedCaptionsTracksAvailable | ( | ) | const |
Returns true if the closed captions tracks for the current media have been loaded. Returns false if the tracks are currently unavailable.
Once tracks become available they can be selected at which point they will begin rendering.
|
protected |
Changes the playback state which the player will be in when media is loaded and in the CYIAbstractVideoPlayer::MediaState::Ready state.
|
protected |
Queries audio and closed captioning track availability and emits CYIAbstractVideoPlayer::AvailableAudioTracksChanged and CYIAbstractVideoPlayer::AvailableClosedCaptionsTracksChanged respectively if applicable. Is called each 1000 ms if the player has been prepared and has not been stopped, but can be called manually to check and notify at any time.
|
protectedpure virtual |
|
protectedpure virtual |
Subclasses must implement this function to disable closed captions. This is called when captions are disabled by selecting a track with id ClosedCaptionsTrackInfo::OFF_TRACK_ID.
AudioTrackInfo CYIAbstractVideoPlayer::GetActiveAudioTrack | ( | ) | const |
Returns information about the audio track which is currently selected.
If the media has no audio tracks or if audio tracks are unavailable this method will return an AudioTrackInfo that has AudioTrackInfo::isValid set to false.
|
protectedpure virtual |
Subclasses must implement this function to return information about the active audio track.
This function is only called if tracks are available, so a valid AudioTrackInfo instance must be returned.
ClosedCaptionsTrackInfo CYIAbstractVideoPlayer::GetActiveClosedCaptionsTrack | ( | ) | const |
Returns information about the closed captions track which is currently selected.
If the media has no closed captions tracks or if closed captions tracks are unavailable this method will return a ClosedCaptionsTrackInfo that has a ClosedCaptionsTrackInfo::id of ClosedCaptionsTrackInfo::OFF_TRACK_ID.
|
protectedpure virtual |
Subclasses must implement this function to return information about the active closed captions track.
This function is only called if tracks are available, so a valid ClosedCaptionsTrackInfo instance must be returned. If captions are disabled then a default constructed ClosedCaptionsTrackInfo must be returned.
AdaptiveResolutionInterface* CYIAbstractVideoPlayer::GetAdaptiveResolutionInterface | ( | ) |
Returns the adaptive playback resolution control interface associated with the player. Returns null if the interface is not supported by the current player implementation.
const AdaptiveResolutionInterface* CYIAbstractVideoPlayer::GetAdaptiveResolutionInterface | ( | ) | const |
|
protectedvirtual |
Subclasses may implement this function to provide an adaptive playback resolution control interface. By default this returns null.
std::vector<AudioTrackInfo> CYIAbstractVideoPlayer::GetAudioTracks | ( | ) | const |
Returns information about the audio tracks for the currently loaded media.
These may become available at any point during preparation and playback. This API reflects what is currently available from the media. Connect to CYIAbstractVideoPlayer::AudioTracksAvailabilityChanged to get the tracks as soon as they are available.
If the video does not have any audio tracks, then a vector of size 0 is returned.
|
protectedpure virtual |
Subclasses must implement this function to return a vector of available audio tracks for the currently loaded media.
The iDs of the returned tracks must be compatible with CYIAbstractVideoPlayer::SelectAudioTrack_.
This function is called each 1000 ms to check for updates to the available audio tracks.
BackgroundPlaybackInterface* CYIAbstractVideoPlayer::GetBackgroundPlaybackInterface | ( | ) |
Returns the background playback interface associated with the player. Returns null if the interface is not supported by the current player implementation.
const BackgroundPlaybackInterface* CYIAbstractVideoPlayer::GetBackgroundPlaybackInterface | ( | ) | const |
|
protectedvirtual |
Subclasses may implement this function to provide a background playback interface. By default this returns null.
BufferingInterface* CYIAbstractVideoPlayer::GetBufferingInterface | ( | ) |
Returns the buffering interface associated with the player. Returns null if the interface is not supported by the current player implementation.
const BufferingInterface* CYIAbstractVideoPlayer::GetBufferingInterface | ( | ) | const |
|
protectedvirtual |
Subclasses may implement this function to provide a buffer length interface. By default this returns null.
CYIClosedCaptionsDispatcher* CYIAbstractVideoPlayer::GetClosedCaptionsDispatcher | ( | ) | const |
|
protectedvirtual |
Subclasses which need to manually render captions can use this to return their closed captions dispatcher.
CYIClosedCaptionsStyleManager* CYIAbstractVideoPlayer::GetClosedCaptionsStyleManager | ( | ) | const |
std::vector<ClosedCaptionsTrackInfo> CYIAbstractVideoPlayer::GetClosedCaptionsTracks | ( | ) | const |
Returns information about the closed captions tracks for the currently loaded media.
These may become available at any point during preparation and playback. This API reflects what is currently available from the media. Connect to CYIAbstractVideoPlayer::AvailableClosedCaptionsTracksChanged to get the tracks as soon as they are available.
A track with special value ClosedCaptionsTrackInfo::OFF_TRACK_ID is always present and is used to disable closed captions rendering.
|
protectedpure virtual |
Subclasses must implement this function to return a vector of available closed captions tracks for the currently loaded media. The "off" track is added by CYIAbstractVideoPlayer and must not be returned in this list.
The iDs of the returned tracks must be compatible with CYIAbstractVideoPlayer::SelectClosedCaptionsTrack_.
This function is called each 1000 ms to check for updates to the available audio tracks.
uint64_t CYIAbstractVideoPlayer::GetCurrentTimeMs | ( | ) | const |
Returns the current playback time of the video in milliseconds. Returns 0 prior to the emission of the CYIAbstractVideoPlayer::DurationChanged signal for the current video media.
|
protectedpure virtual |
Subclasses must implement this function to report the current time of the video.
const DRMConfiguration* CYIAbstractVideoPlayer::GetDRMConfiguration | ( | ) | const |
Returns the current DRM configuration that was provided when the player was prepared.
DRMConfiguration* CYIAbstractVideoPlayer::GetDRMConfiguration | ( | ) |
Returns the current DRM configuration that was provided when the player was prepared.
uint64_t CYIAbstractVideoPlayer::GetDurationMs | ( | ) | const |
Returns the duration of the video in milliseconds. Returns 0 if the player is in the CYIAbstractVideoPlayer::MediaState::Unloaded state.
|
protectedpure virtual |
Subclasses must implement this function to report the duration of the video.
HeadphoneJackInterface* CYIAbstractVideoPlayer::GetHeadphoneJackInterface | ( | ) |
Returns the headphone jack interface associated with the player. Returns null if the interface is not supported by the current player implementation.
const HeadphoneJackInterface* CYIAbstractVideoPlayer::GetHeadphoneJackInterface | ( | ) | const |
|
protectedvirtual |
Subclasses may implement this function to provide a headphone jack interface. By default this returns null.
std::vector<SeekableRange> CYIAbstractVideoPlayer::GetLiveSeekableRanges | ( | ) | const |
Returns the seekable time ranges of the current stream. Only available for live streams.
|
protectedpure virtual |
Subclasses must implement this function to report the live seekable ranges.
LiveSessionInterface* CYIAbstractVideoPlayer::GetLiveSessionInterface | ( | ) |
Returns the live session control interface associated with the player. Returns null if the interface is not supported by the current player implementation.
const LiveSessionInterface* CYIAbstractVideoPlayer::GetLiveSessionInterface | ( | ) | const |
|
protectedvirtual |
Subclasses may implement this function to provide a live session control interface. By default this returns null.
MediaPlaybackControlsInterface* CYIAbstractVideoPlayer::GetMediaPlaybackControlsInterface | ( | ) |
Returns the media playback controls interface associated with the player. Returns null if the interface is not supported by the current player implementation.
const MediaPlaybackControlsInterface* CYIAbstractVideoPlayer::GetMediaPlaybackControlsInterface | ( | ) | const |
|
protectedvirtual |
Subclasses may implement this function to provide a media playback control interface. By default this returns null.
uint64_t CYIAbstractVideoPlayer::GetMinimumTimeUpdateIntervalMs | ( | ) | const |
Returns the minimum current time update interval in milliseconds. The default value is 100 milliseconds.
CYIString CYIAbstractVideoPlayer::GetName | ( | ) | const |
Returns the name of the player.
|
protectedvirtual |
Returns the name of the player.
NetworkTimeoutInterface* CYIAbstractVideoPlayer::GetNetworkTimeoutInterface | ( | ) |
Returns the network timeout controls interface associated with the player. Returns null if the interface is not supported by the current player implementation.
const NetworkTimeoutInterface* CYIAbstractVideoPlayer::GetNetworkTimeoutInterface | ( | ) | const |
|
protectedvirtual |
Subclasses may implement this function to provide a network timeout control interface. By default this returns null.
std::shared_ptr<CYIPlatformViewHandle> CYIAbstractVideoPlayer::GetPlatformPlayerContainerViewHandle | ( | ) | const |
Returns a platform view handle containing the native player container view, if available.
std::shared_ptr<CYIPlatformPlayerHandle> CYIAbstractVideoPlayer::GetPlatformPlayerHandle | ( | ) | const |
Returns a platform player handle containing the native player instance, if available.
CYIAbstractVideoPlayer::PlayerState CYIAbstractVideoPlayer::GetPlayerState | ( | ) | const |
Returns the current state of the player.
|
protected |
Returns the initial playback state requested when media was loaded with Prepare().
Statistics CYIAbstractVideoPlayer::GetStatistics | ( | ) | const |
Returns the latest statistics from the player.
|
protectedvirtual |
Returns the latest statistics from the player.
CYIVideoSurface* CYIAbstractVideoPlayer::GetSurface | ( | ) | const |
Returns the player surface into which the video is being rendered. This is owned by the player and must not be deleted or retained independently.
TimedMetadataInterface* CYIAbstractVideoPlayer::GetTimedMetadataInterface | ( | ) |
Returns the timed metadata interface associated with the player. Returns null if the interface is not supported by the current player implementation.
const TimedMetadataInterface* CYIAbstractVideoPlayer::GetTimedMetadataInterface | ( | ) | const |
|
protectedvirtual |
Subclasses may implement this function to provide a timed metadata interface. By default this returns null.
CYIString CYIAbstractVideoPlayer::GetVersion | ( | ) | const |
Returns the version of the player.
|
protectedvirtual |
Returns the version of the player.
|
protected |
Returns the material associated with the player's CYIVideoSurface. If the CYIVideoSurface::GetCapabilities() reports that it does not render to texture this will be null.
VideoRequestHTTPHeadersInterface* CYIAbstractVideoPlayer::GetVideoRequestHTTPHeadersInterface | ( | ) |
Returns the custom video request HTTP headers interface associated with the player. Returns null if the interface is not supported by the current player implementation.
const VideoRequestHTTPHeadersInterface* CYIAbstractVideoPlayer::GetVideoRequestHTTPHeadersInterface | ( | ) | const |
|
protectedvirtual |
Subclasses may implement this function to provide a custom video request HTTP headers interface. By default this returns null.
|
protectedvirtual |
Subclasses may implement this function to return true if initial bandwidth hint is handled.
If implemented to return true, the player implementation should use the value m_initialBandwidthHint, set by a call to SetInitialBandwidthHint, to select an initial playback variant with a bitrate suitable for the network bandwidth hint.
|
protectedvirtual |
Subclasses may implement this function to return true if the bitrate changed events are handled by the native implementation. The default implementation returns false.
If implemented to return true, the player implementation should detect changes in audio, video, and total bitrate, and emit the signals VideoBitrateChanged, AudioBitrateChanged, TotalBitrateChanged.
|
protectedvirtual |
Subclasses may implement this function to return true if seek started/completed events are handled by the native implementation. The default implementation returns false.
If implemented to return true, the player implementation should emit NotifySeekCompleted when the seek has finished. When not implemented to return true the default implementation will emit SeekCompleted when the current time updates appropriately.
|
protectedvirtual |
Subclasses may implement this function to return true if the start time is handled by the player implementation. The default implementation returns false.
If implemented to return true, the player implementation should use the member m_initialStartTimeMs, which is set when Prepare is called, to set the start time of the asset.
void CYIAbstractVideoPlayer::Init | ( | ) |
Initializes the player and its video surface.
|
protectedvirtual |
bool CYIAbstractVideoPlayer::IsMuted | ( | ) | const |
|
protectedpure virtual |
Subclasses must implement this function, and return true if and only if the player is muted.
void CYIAbstractVideoPlayer::Mute | ( | bool | mute | ) |
Mute the player, so that no audio is played. By default the player is not muted.
|
protectedpure virtual |
Subclasses must implement this function to mute the player when mute is true, and unmute when mute is false.
|
protected |
Called by subclasses when a DRM configuration refresh is needed. It will call the user's RefreshDRMConfigurationCallback, if that callback is set.
void CYIAbstractVideoPlayer::Pause | ( | ) |
Pauses video playback.
|
protectedpure virtual |
Subclasses must implement this function to pause the video. When the underlying player notifies that playback has paused the player must be transitioned into the CYIAbstractVideoPlayer::PlaybackState::Paused state as follows:
void CYIAbstractVideoPlayer::Play | ( | ) |
Starts the playback of the prepared video asset, or resumes playback if the player is paused.
|
protectedpure virtual |
Subclasses must implement this function to play the video. When the underyling player notifies that playback has began the player must be transitioned into the CYIAbstractVideoPlayer::PlaybackState::Playing state as follows:
void CYIAbstractVideoPlayer::Prepare | ( | const CYIUrl & | videoURI, |
StreamingFormat | formatHint, | ||
CYIAbstractVideoPlayer::PlaybackState | initialState = CYIAbstractVideoPlayer::PlaybackState::Paused , |
||
std::unique_ptr< DRMConfiguration > | pDRMConfiguration = nullptr , |
||
uint64_t | startTimeMs = 0 |
||
) |
Prepares the player with the provided video file at videoURI.
The formatHint and the scheme of the pDRMConfiguration will be validated against the player. If the player does not support the specified format/DRM scheme, a CYIAbstractVideoPlayer::ErrorCode::UnsupportedFormat error will be emitted. If the format hint does not match the actual content of the URI, then the player may encounter a playback error or proceed without any error.
If specified startTimeMs will start set the time in milliseconds that the asset should start playing.
If the prepare operation was successful the player will transition into the CYIAbstractVideoPlayer::MediaState::Ready state. initialState represents the state the player will be in after Prepare() completes.
void CYIAbstractVideoPlayer::Prepare | ( | const std::shared_ptr< CYIAssetVideo > & | videoAsset, |
StreamingFormat | formatHint, | ||
CYIAbstractVideoPlayer::PlaybackState | initialState = CYIAbstractVideoPlayer::PlaybackState::Paused , |
||
std::unique_ptr< DRMConfiguration > | pDRMConfiguration = nullptr , |
||
uint64_t | startTimeMs = 0 |
||
) |
Prepares the player with the provided video file at videoAsset. If videoAsset is null, an error will be reported.
|
protectedpure virtual |
Subclasses must implement this function to prepare the video.
When a video is preparing, the player must be transitioned into the CYIAbstractVideoPlayer::MediaState::Preparing state as follows:
This transition typically occurs when the underlying video player notifies that it has begun preparing the media. If the underlying player does not report that media is preparing making this transition at the start of Prepare_ is recommended.
Once the video has completed preparing the player must be transitioned into the CYIAbstractVideoPlayer::MediaState::Ready state as follows:
This transition typically occurs when the underlying video player notifies that it has completed preparing the media. If the underlying player does not report that the media is ready making this transition at the end of Prepare_ is recommended.
void CYIAbstractVideoPlayer::Seek | ( | uint64_t | seekPositionMs | ) |
Seek to seekPositionMs in the video, in milliseconds.
|
protectedpure virtual |
Subclasses must implement this function to seek the video to a specific seekPositionMS in the video media. When seeking backwards from playback complete, the player must remain paused.
bool CYIAbstractVideoPlayer::SelectAudioTrack | ( | uint32_t | id | ) |
Switches the video player's audio to the track indicated by the given id.
If the video is playing, playback will not be stopped during the switch.
Returns true if the track exists and was successfully selected.
Returns false if no track with id is available.
|
protectedpure virtual |
Subclasses must implement this function to switch the video player's current audio track to the one referenced by id.
CYIAbstractVideoPlayer::SelectAudioTrack will validate the id prior to this function being called.
bool CYIAbstractVideoPlayer::SelectClosedCaptionsTrack | ( | uint32_t | id | ) |
Switches the video player's closed captions track to the track indicated by the given id.
If the video is playing, playback will not be stopped during the switch.
Returns true if the track exists and was successfully selected, note that selection may take time to take effect. ClosedCaptionsTrackInfo::OFF_TRACK_ID is a special value used to disable closed captions rendering.
Returns false if no track with id is available, or if id is not ClosedCaptionsTrackInfo::OFF_TRACK_ID.
|
protectedpure virtual |
Subclasses must implement this function to switch the video player's current closed captions track to the one referenced by id. Selecting a track must initiate the rendering of the subtitles to screen.
CYIAbstractVideoPlayer::SelectClosedCaptionsTrack will validate the id prior to this function being called. This function will not be called when disabling closed captions, id is guaranteed not to be ClosedCaptionsTrackInfo::OFF_TRACK_ID.
void CYIAbstractVideoPlayer::SetClosedCaptionsEnabled | ( | bool | enabled | ) |
Enables or disables closed captioning.
void CYIAbstractVideoPlayer::SetInitialBandwidthHint | ( | uint64_t | initialBandwidthHint | ) |
Sets the initial network bandwidth hint, in bits per second, which the player will use to select a starting bitrate for the video session.
void CYIAbstractVideoPlayer::SetMaxBitrate | ( | uint64_t | maxBitrate | ) |
Sets the maximum bitrate to maxBitrate, in bits per second, which the player will use when streaming from an adaptive media source. By default there is no bitrate restriction applied.
|
protectedvirtual |
Subclasses may implement this function to set the maximum bitrate, in bits per second, which an adaptive media source will reach.
void CYIAbstractVideoPlayer::SetMinimumTimeUpdateIntervalMs | ( | uint64_t | minimumTimeUpdateIntervalMs | ) |
Sets the minimum current time update interval in milliseconds. This is the shortest interval between CurrentTimeUpdated being emitted, the actual time between updates may be greater depending on the underlying player's current time update interval.
|
protected |
Updates the platform player container view handle and emits the CYIAbstractVideoPlayer::PlatformPlayerContainerViewHandleChanged signal.
|
protected |
Updates the platform player handle and emits the CYIAbstractVideoPlayer::PlatformPlayerHandleChanged signal.
void CYIAbstractVideoPlayer::SetRefreshDRMConfigurationCallback | ( | RefreshDRMConfigurationCallback | callback | ) |
void CYIAbstractVideoPlayer::SetUserAgent | ( | const CYIString & | userAgent | ) |
Set the user agent to be used by the player for requests on manifests and video segments.
|
protectedvirtual |
Subclasses may implement this function to set the user agent.
|
protected |
Sets the video surface size, in pixels.
void CYIAbstractVideoPlayer::Stop | ( | ) |
Stops the video playback. This will unload the current video and set the player into the CYIAbstractVideoPlayer::MediaState::Unloaded state.
|
protectedpure virtual |
Subclasses must implement this function to stop the video and clean-up any resources related to the video media as the player will be transitioned into the CYIAbstractVideoPlayer::MediaState::Unloaded after this function executes.
bool CYIAbstractVideoPlayer::SupportsFormat | ( | StreamingFormat | streamingFormat, |
DRMScheme | drmScheme = DRMScheme::None |
||
) |
Query the player to determine if streamingFormat and drmScheme combination is supported by the player. Returns true if the provided format and DRM scheme combination is supported by the player.
|
protectedpure virtual |
Subclasses must implement this function to indicate that they support a given format.
|
protected |
Refreshes the playback time internal to the CYIAbstractVideoPlayer. Emits CYIAbstractVideoPlayer::CurrentTimeUpdated and calls the associated caption render's IYIClosedCaptionsRenderer::OnVideoTimeUpdated if the time has changed since the last time this method was called.
|
friend |
CYISignal<float> CYIAbstractVideoPlayer::AudioBitrateChanged |
Signals that the audio bitrate measured in kilobits per second has changed. This may be emitted at any point.
CYISignal<std::vector<AudioTrackInfo> > CYIAbstractVideoPlayer::AvailableAudioTracksChanged |
Signals that the available audio tracks for the current media have changed. This may be emitted at any point.
CYISignal<std::vector<ClosedCaptionsTrackInfo> > CYIAbstractVideoPlayer::AvailableClosedCaptionsTracksChanged |
Signals that the available closed captions tracks for the current media have changed. This may be emitted at any point.
CYISignal CYIAbstractVideoPlayer::BufferingEnded |
Player buffering ended notification. An application can clear a buffering indicator, if one has been displayed, when this signal is emitted. After this signal is emitted the player will be in the CYIAbstractVideoPlayer::PlaybackState::Playing or CYIAbstractVideoPlayer::PlaybackState::Paused state depending on the state the player was in prior to entering the CYIAbstractVideoPlayer::PlaybackState::Buffering state.
CYISignal CYIAbstractVideoPlayer::BufferingStarted |
Player buffering started notification. An application can display a buffering indicator when this signal is emitted. After this signal is emitted the player will be in the CYIAbstractVideoPlayer::PlaybackState::Buffering state.
CYISignal<uint64_t> CYIAbstractVideoPlayer::CurrentTimeUpdated |
Signals that the current time in the video playback has updated.
CYISignal<uint64_t> CYIAbstractVideoPlayer::DurationChanged |
Signals that the duration of the loaded video media has changed. This typically occurs after loading new video media with a call to Prepare(). It is recommended to update the duration visible to the application user when this signal is emitted.
Player reported an error. An application can display an error notification his signal is emitted.
CYISignal CYIAbstractVideoPlayer::Finalized |
Signals that the player has shutdown and cleaned up. On PlayStation 3 and PlayStation 4, the player will stall if deleted or prepared while already being stopped. It is recommended to listen to this signal before doing so. On other platforms this signal is sent right away on Stop().
|
protected |
The initial bandwidth hint, used by player implementations to select an initial playback variant with a suitable bitrate.
|
protected |
Set when Prepare is called to control the start time of the asset.
If the player implementation will handle start time, HasNativeStartTimeHandling_ must be overridden to be true. Otherwise a default behaviour will be used.
|
protected |
The last known maximum bitrate.
|
protected |
The closed captions dispatcher of this player. This is used to dispatch closed caption cues to the surface view's rendering scene node.
|
protected |
The DRM configuration that was provided to the player when CYIAbstractVideoPlayer::Prepare was called. This configuration will be provided when the media is DRM protected. Concrete player implementations must use this configuration to prepare the DRM protected media for playback.
|
protected |
The CYIAbstractVideoPlayer's instance of the CYIVideoPlayerStateManager. This is used to manage media and state transitions within the player.
|
protected |
The closed captions style manager of this player. This is used to set a custom style to captions of the player.
|
protected |
Called by the player when a new DRM configuration may be needed.
|
protected |
Notifies the CYIAbstractVideoPlayer that the duration of the current video media has changed. This typically only occurs when the media is changed.
Notifies the CYIAbstractVideoPlayer that an error has occured, this will transition the player into the CYIAbstractVideoPlayer::MediaState::Unloaded state. The CYIAbstractVideoPlayer::Error object parameter should be populated with the error that has occured.
|
protected |
Notifies the CYIAbstractVideoPlayer that the video has reached the end of stream for the current video media.
|
protected |
Notifies the CYIAbstractVideoPlayer when the seek operation has completed. The first signal parameter indicates whether the seek operation succeeded and the second parameter is the current player position in milliseconds.
CYISignal CYIAbstractVideoPlayer::Paused |
Signals that playback has paused. After this signal is emitted the player will be in the CYIAbstractVideoPlayer::PlaybackState::Paused state.
CYISignal<std::shared_ptr<CYIPlatformViewHandle> , std::shared_ptr<CYIPlatformViewHandle> > CYIAbstractVideoPlayer::PlatformPlayerContainerViewHandleChanged |
Platform player container view handle changed notification. Once the native platform player's container view has been created, changed or destroyed, this signal will be emitted along with the previous and new handles, if available on the current platform. Any retained version of the previous view handle should be discarded and no longer used.
CYISignal<std::shared_ptr<CYIPlatformPlayerHandle> , std::shared_ptr<CYIPlatformPlayerHandle> > CYIAbstractVideoPlayer::PlatformPlayerHandleChanged |
Platform player handle changed notification. Once the native platform player has been created, changed or destroyed, this signal will be emitted along with the previous and new handles, if available on the current platform. Any retained version of the previous player handle should be discarded and no longer used.
CYISignal CYIAbstractVideoPlayer::PlaybackComplete |
Signals that the playback of the currently loaded video media has completed. After this signal is emitted the player will be in the CYIAbstractVideoPlayer::PlaybackState::Paused state.
CYISignal<const CYIAbstractVideoPlayer::PlayerState &> CYIAbstractVideoPlayer::PlayerStateChanged |
Signals that the internal player state has changed.
CYISignal CYIAbstractVideoPlayer::Playing |
Signals that playback has began. This can either be the initial playback or playback resuming after CYIAbstractVideoPlayer::PlaybackState::Paused or CYIAbstractVideoPlayer::PlaybackState::Buffering states. After this signal is emitted the player will be in the CYIAbstractVideoPlayer::PlaybackState::Playing state.
CYISignal CYIAbstractVideoPlayer::Preparing |
Signals that the the player has started preparing a video for playback. This occurs after a call to Prepare() given the provided video format is supported by the target platform. After this signal is emitted the player will be in the CYIAbstractVideoPlayer::MediaState::Preparing state.
CYISignal CYIAbstractVideoPlayer::Ready |
Signals that the call to Prepare() was successful. The video is ready to be interacted with and information about the video can be queried. After this signal is emitted the player will be in the CYIAbstractVideoPlayer::MediaState::Ready state.
CYISignal<bool, uint64_t> CYIAbstractVideoPlayer::SeekCompleted |
Signals that a seek operation has completed. The first signal parameter indicates whether the seek operation was successful or not and the second parameter is the playback position after the seek completed in milliseconds.
CYISignal<float> CYIAbstractVideoPlayer::TotalBitrateChanged |
Signals that the combined video and audio bitrate measured in kilobits per second has changed. This may be emitted at any point.
CYISignal<float> CYIAbstractVideoPlayer::VideoBitrateChanged |
Signals that the video bitrate measured in kilobits per second has changed. This may be emitted at any point.