You.i Engine
CYIAbstractVideoPlayer Class Referenceabstract

Detailed Description

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:

CYIExoPlayerVideoPlayer *pExoPlayerVideoPlayer = YiDynamicCast<CYIExoPlayerVideoPlayer>(pAbstractPlayer);
if (pExoPlayerVideoPlayer)
{
// Use functions specific to the ExoPlayer video player here.
}
// Play() is available on CYIAbstractVideoPlayer so there is no need to use a concrete type.
pAbstractPlayer->Play();
Note
Some of the implementations of CYIAbstractVideoPlayer provided by You.i Engine only support one instance.

#include <player/YiAbstractVideoPlayer.h>

Inheritance diagram for CYIAbstractVideoPlayer:

Classes

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  MediaPlaybackControlsInterface
 
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 VideoMetadata = std::map< CYIString, CYIString >
 
using RefreshDRMConfigurationCallback = std::function< std::unique_ptr< CYIAbstractVideoPlayer::DRMConfiguration >(std::unique_ptr< CYIAbstractVideoPlayer::DRMConfiguration >)>
 

Public Member Functions

virtual ~CYIAbstractVideoPlayer ()
 
CYIString GetName () const
 
CYIString GetVersion () const
 
Statistics GetStatistics () const
 
void Init ()
 
void Prepare (const CYIUrl &videoURI, StreamingFormat formatHint, CYIAbstractVideoPlayer::PlaybackState initialState=CYIAbstractVideoPlayer::PlaybackState::Paused, std::unique_ptr< DRMConfiguration > pDRMConfiguration=nullptr, uint64_t startTimeMs=0)
 
void 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)
 
void Play ()
 
void Pause ()
 
void Stop ()
 
std::vector< SeekableRangeGetLiveSeekableRanges () const
 
void Seek (uint64_t seekPositionMs)
 
bool SupportsFormat (StreamingFormat streamingFormat, DRMScheme drmScheme=DRMScheme::None)
 
uint64_t GetDurationMs () const
 
uint64_t GetCurrentTimeMs () const
 
CYIAbstractVideoPlayer::PlayerState GetPlayerState () const
 
void SetClosedCaptionsEnabled (bool enabled)
 
bool AreClosedCaptionsTracksAvailable () const
 
bool SelectClosedCaptionsTrack (uint32_t id)
 
std::vector< ClosedCaptionsTrackInfoGetClosedCaptionsTracks () const
 
ClosedCaptionsTrackInfo GetActiveClosedCaptionsTrack () const
 
CYIClosedCaptionsDispatcherGetClosedCaptionsDispatcher () const
 
CYIVideoSurfaceGetSurface () const
 
bool AreAudioTracksAvailable () const
 
bool SelectAudioTrack (uint32_t id)
 
std::vector< AudioTrackInfoGetAudioTracks () const
 
AudioTrackInfo GetActiveAudioTrack () const
 
bool IsMuted () const
 
void Mute (bool mute)
 
void SetMaxBitrate (uint64_t maxBitrate)
 
void SetUserAgent (const CYIString &userAgent)
 
void SetVideoMetadata (const CYIAbstractVideoPlayer::VideoMetadata &metadata)
 
const DRMConfigurationGetDRMConfiguration () const
 
DRMConfigurationGetDRMConfiguration ()
 
BackgroundPlaybackInterfaceGetBackgroundPlaybackInterface () const
 
HeadphoneJackInterfaceGetHeadphoneJackInterface () const
 
BufferingInterfaceGetBufferingInterface () const
 
TimedMetadataInterfaceGetTimedMetadataInterface () const
 
VideoRequestHTTPHeadersInterfaceGetVideoRequestHTTPHeadersInterface ()
 
MediaPlaybackControlsInterfaceGetMediaPlaybackControlsInterface () const
 
void SetRefreshDRMConfigurationCallback (RefreshDRMConfigurationCallback callback)
 
- Public Member Functions inherited from CYISignalHandler
 CYISignalHandler ()
 
 CYISignalHandler (const CYISignalHandler &rSignalHandler)
 
virtual ~CYISignalHandler ()
 
CYISignalHandleroperator= (const CYISignalHandler &rSignalHandler)
 
void MoveToThread (CYIThread *pThread)
 This function allows the user to override the default thread affinity to any CYIThread that may or may not be running. More...
 
CYIThreadHandle GetThreadAffinity () const
 
void SetThreadAffinity (const CYIThreadHandle &rThreadAffinity)
 
virtual bool IsConnected () const
 
virtual bool IsConnected (const CYISignalBase &rSignal) const
 
void Disconnect (CYISignalBase &rSignal)
 
void DisconnectFromAllSignals ()
 
- Public Member Functions inherited from CYIThread::Listener
 Listener ()
 
virtual ~Listener ()
 
virtual void OnThreadStarted (CYIThread *)
 
virtual void OnThreadTerminated (CYIThread *)
 
virtual void OnThreadFinished (CYIThread *)
 

Public Attributes

CYISignal BufferingStarted
 
CYISignal BufferingEnded
 
CYISignal< ErrorErrorOccurred
 
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 Member Functions

 CYIAbstractVideoPlayer ()
 
const std::shared_ptr< CYIMaterial > & GetVideoMaterial () const
 
void SetVideoSurfaceSize (const glm::ivec2 &size)
 
void ChangeInitialPlaybackState (CYIAbstractVideoPlayer::PlaybackState initialState)
 
CYIAbstractVideoPlayer::PlaybackState GetRequestedInitialPlaybackState () const
 
void CheckAndNotifyMediaTracksChanged ()
 
void UpdateCurrentTime ()
 
void OnRefreshDRMConfiguration ()
 
virtual CYIString GetName_ () const
 
virtual CYIString GetVersion_ () const
 
virtual Statistics GetStatistics_ () const
 
virtual void Init_ ()
 
virtual std::unique_ptr< CYIVideoSurfaceCreateSurface_ ()=0
 
virtual bool SupportsFormat_ (StreamingFormat streamingFormat, DRMScheme drmScheme=DRMScheme::None) const =0
 
virtual bool HasNativeStartTimeHandling_ () const
 
virtual bool HasNativeBitrateEventHandling_ () const
 
virtual bool HasNativeSeekEventHandling_ () const
 
virtual void Prepare_ (const CYIUrl &videoURI, StreamingFormat format)=0
 
virtual void Play_ ()=0
 
virtual void Pause_ ()=0
 
virtual void Stop_ ()=0
 
virtual uint64_t GetDurationMs_ () const =0
 
virtual uint64_t GetCurrentTimeMs_ () const =0
 
virtual std::vector< SeekableRangeGetLiveSeekableRanges_ () const =0
 
virtual void Seek_ (uint64_t seekPositionMS)=0
 
virtual bool SelectAudioTrack_ (uint32_t id)=0
 
virtual std::vector< AudioTrackInfoGetAudioTracks_ () const =0
 
virtual CYIAbstractVideoPlayer::AudioTrackInfo GetActiveAudioTrack_ () const =0
 
virtual bool IsMuted_ () const =0
 
virtual void Mute_ (bool mute)=0
 
virtual void DisableClosedCaptions_ ()=0
 
virtual bool SelectClosedCaptionsTrack_ (uint32_t id)=0
 
virtual std::vector< ClosedCaptionsTrackInfoGetClosedCaptionsTracks_ () const =0
 
virtual CYIAbstractVideoPlayer::ClosedCaptionsTrackInfo GetActiveClosedCaptionsTrack_ () const =0
 
virtual void GetClosedCaptionsDispatcher_ () const
 
virtual void SetMaxBitrate_ (uint64_t maxBitrate)
 
virtual void SetUserAgent_ (const CYIString &userAgent)
 
virtual void SetVideoMetadata_ (const CYIAbstractVideoPlayer::VideoMetadata &metadata)
 
virtual BackgroundPlaybackInterfaceGetBackgroundPlaybackInterface_ () const
 
virtual HeadphoneJackInterfaceGetHeadphoneJackInterface_ () const
 
virtual BufferingInterfaceGetBufferingInterface_ () const
 
virtual TimedMetadataInterfaceGetTimedMetadataInterface_ () const
 
virtual VideoRequestHTTPHeadersInterfaceGetVideoRequestHTTPHeadersInterface_ ()
 
virtual MediaPlaybackControlsInterfaceGetMediaPlaybackControlsInterface_ () const
 

Protected Attributes

CYISignal< ErrorNotifyErrorOccurred
 
CYISignal NotifyPlaybackComplete
 
CYISignal< uint64_t > NotifyDurationChanged
 
CYISignal< bool, uint64_t > NotifySeekCompleted
 
std::unique_ptr< CYIVideoPlayerStateManagerm_pStateManager
 
std::unique_ptr< CYIClosedCaptionsDispatcherm_pClosedCaptionsDispatcher
 
std::unique_ptr< DRMConfigurationm_pDRMConfiguration
 
uint64_t m_maxBitrate
 
uint64_t m_initialStartTimeMs
 
RefreshDRMConfigurationCallback m_refreshDRMConfigurationCallback
 

Friends

class CYIVideoPlayerStateManager
 
class TimeUpdater
 

Member Typedef Documentation

◆ RefreshDRMConfigurationCallback

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.

◆ RTTIInstantiatability

using CYIAbstractVideoPlayer::RTTIInstantiatability = CYIRuntimeTypeInfo::NonInstantiableTag

◆ VideoMetadata

Alias type for metadata associated with video.

See also
CYIAbstractVideoPlayer::SetVideoMetadata

Member Enumeration Documentation

◆ DRMScheme

Enumeration of available DRM schemes.

See also
SupportsFormat()
Enumerator
None 
FairPlay 
PlayReady 
WidevineModular 
WidevineModularCustomRequest 

◆ ErrorCode

Enumeration of the possible errors which the player can emit.

See also
CYIAbstractVideoPlayer::ErrorOccurred
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.

See also
CYIVideoPlayerStateManager
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.

◆ MediaState

Enumeration of the states relating to the preparation of media for the video player.

See also
GetPlayerState()
CYIVideoPlayerStateManager
Enumerator
Unloaded 

Represents that no video media is currently loaded into the player for playback. This is the default media state for the player.

See also
Stop()
Preparing 

Represents that the video media has been provided to the player and is in the process of being loaded for playback.

See also
Prepare()
CYIAbstractVideoPlayer::Preparing
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.

See also
CYIAbstractVideoPlayer::Ready

◆ PlaybackState

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.

See also
GetPlayerState()
CYIVideoPlayerStateManager
Enumerator
Playing 

Represents that the video player is currently playing the video media.

See also
Play()
CYIAbstractVideoPlayer::Playing
Paused 

Represents that the video player is currently paused.

See also
Pause()
CYIAbstractVideoPlayer::Paused
Buffering 

Represents that the video player is buffering the video media for playback. The player will enter this state when it requires additional data before playback can resume.

See also
Pause()
CYIAbstractVideoPlayer::BufferingStarted
CYIAbstractVideoPlayer::BufferingEnded

◆ StreamingFormat

Enumeration of available video media streaming formats.

See also
SupportsFormat()
Enumerator
HLS 
Smooth 
DASH 
MP4 

Constructor & Destructor Documentation

◆ ~CYIAbstractVideoPlayer()

virtual CYIAbstractVideoPlayer::~CYIAbstractVideoPlayer ( )
virtual

◆ CYIAbstractVideoPlayer()

CYIAbstractVideoPlayer::CYIAbstractVideoPlayer ( )
protected

Member Function Documentation

◆ AreAudioTracksAvailable()

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.

See also
AvailableAudioTracksChanged

◆ AreClosedCaptionsTracksAvailable()

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.

See also
AvailableClosedCaptionsTracksChanged

◆ ChangeInitialPlaybackState()

void CYIAbstractVideoPlayer::ChangeInitialPlaybackState ( CYIAbstractVideoPlayer::PlaybackState  initialState)
protected

Changes the playback state which the player will be in when media is loaded and in the CYIAbstractVideoPlayer::MediaState::Ready state.

See also
Prepare.

◆ CheckAndNotifyMediaTracksChanged()

void CYIAbstractVideoPlayer::CheckAndNotifyMediaTracksChanged ( )
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.

◆ CreateSurface_()

virtual std::unique_ptr<CYIVideoSurface> CYIAbstractVideoPlayer::CreateSurface_ ( )
protectedpure virtual

◆ DisableClosedCaptions_()

virtual void CYIAbstractVideoPlayer::DisableClosedCaptions_ ( )
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.

Implemented in CYIExoPlayerVideoPlayer, CYIUWPVideoPlayer, CYIVLCVideoPlayer, and CYIVestelVideoPlayer.

◆ GetActiveAudioTrack()

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.

See also
AreAudioTracksAvailable

◆ GetActiveAudioTrack_()

virtual CYIAbstractVideoPlayer::AudioTrackInfo CYIAbstractVideoPlayer::GetActiveAudioTrack_ ( ) const
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.

See also
GetAudioTracks_
GetActiveAudioTrack

Implemented in CYIExoPlayerVideoPlayer, CYIUWPVideoPlayer, CYIVLCVideoPlayer, and CYIVestelVideoPlayer.

◆ GetActiveClosedCaptionsTrack()

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.

See also
AreClosedCaptionsTracksAvailable

◆ GetActiveClosedCaptionsTrack_()

virtual CYIAbstractVideoPlayer::ClosedCaptionsTrackInfo CYIAbstractVideoPlayer::GetActiveClosedCaptionsTrack_ ( ) const
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.

See also
GetClosedCaptionsTracks_
SelectClosedCaptionsTrack

Implemented in CYIExoPlayerVideoPlayer, CYIUWPVideoPlayer, CYIVLCVideoPlayer, and CYIVestelVideoPlayer.

◆ GetAudioTracks()

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.

See also
SelectAudioTrack
AreAudioTracksAvailable

◆ GetAudioTracks_()

virtual std::vector<AudioTrackInfo> CYIAbstractVideoPlayer::GetAudioTracks_ ( ) const
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.

Implemented in CYIExoPlayerVideoPlayer, CYIUWPVideoPlayer, CYIVLCVideoPlayer, and CYIVestelVideoPlayer.

◆ GetBackgroundPlaybackInterface()

BackgroundPlaybackInterface* CYIAbstractVideoPlayer::GetBackgroundPlaybackInterface ( ) const

Returns the background playback interface associated with the player. Returns null if the interface is not supported by the current player implementation.

◆ GetBackgroundPlaybackInterface_()

virtual BackgroundPlaybackInterface* CYIAbstractVideoPlayer::GetBackgroundPlaybackInterface_ ( ) const
protectedvirtual

Subclasses may implement this function to provide a background playback interface. By default this returns null.

Reimplemented in CYIExoPlayerVideoPlayer.

◆ GetBufferingInterface()

BufferingInterface* CYIAbstractVideoPlayer::GetBufferingInterface ( ) const

Returns the buffering interface associated with the player. Returns null if the interface is not supported by the current player implementation.

◆ GetBufferingInterface_()

virtual BufferingInterface* CYIAbstractVideoPlayer::GetBufferingInterface_ ( ) const
protectedvirtual

Subclasses may implement this function to provide a buffer length interface. By default this returns null.

Reimplemented in CYIExoPlayerVideoPlayer.

◆ GetClosedCaptionsDispatcher()

CYIClosedCaptionsDispatcher* CYIAbstractVideoPlayer::GetClosedCaptionsDispatcher ( ) const

◆ GetClosedCaptionsDispatcher_()

virtual void CYIAbstractVideoPlayer::GetClosedCaptionsDispatcher_ ( ) const
protectedvirtual

Subclasses which need to manually render captions can use this to return their closed captions dispatcher.

Deprecated:
This function is deprecated. Please assign an instance of CYIClosedCaptionsDispatcher to m_pClosedCaptionsDispatcher instead (if needed) and use GetClosedCaptionsDispatcher() to access it.
Note
This getter has a void return type to cause a compilation error for subclasses which override this function.

◆ GetClosedCaptionsTracks()

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.

See also
SelectClosedCaptionsTrack
AreClosedCaptionsTracksAvailable

◆ GetClosedCaptionsTracks_()

virtual std::vector<ClosedCaptionsTrackInfo> CYIAbstractVideoPlayer::GetClosedCaptionsTracks_ ( ) const
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.

Implemented in CYIExoPlayerVideoPlayer, CYIUWPVideoPlayer, CYIVLCVideoPlayer, and CYIVestelVideoPlayer.

◆ GetCurrentTimeMs()

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.

◆ GetCurrentTimeMs_()

virtual uint64_t CYIAbstractVideoPlayer::GetCurrentTimeMs_ ( ) const
protectedpure virtual

Subclasses must implement this function to report the current time of the video.

See also
GetCurrentTimeMs

Implemented in CYIExoPlayerVideoPlayer, CYIUWPVideoPlayer, CYIVLCVideoPlayer, and CYIVestelVideoPlayer.

◆ GetDRMConfiguration() [1/2]

const DRMConfiguration* CYIAbstractVideoPlayer::GetDRMConfiguration ( ) const

Returns the current DRM configuration that was provided when the player was prepared.

Note
The player retains ownership of the DRM configuration.
See also
Prepare

◆ GetDRMConfiguration() [2/2]

DRMConfiguration* CYIAbstractVideoPlayer::GetDRMConfiguration ( )

Returns the current DRM configuration that was provided when the player was prepared.

Note
The player retains ownership of the DRM configuration.
See also
Prepare

◆ GetDurationMs()

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.

◆ GetDurationMs_()

virtual uint64_t CYIAbstractVideoPlayer::GetDurationMs_ ( ) const
protectedpure virtual

Subclasses must implement this function to report the duration of the video.

See also
GetDurationMs

Implemented in CYIExoPlayerVideoPlayer, CYIUWPVideoPlayer, CYIVLCVideoPlayer, and CYIVestelVideoPlayer.

◆ GetHeadphoneJackInterface()

HeadphoneJackInterface* CYIAbstractVideoPlayer::GetHeadphoneJackInterface ( ) const

Returns the headphone jack interface associated with the player. Returns null if the interface is not supported by the current player implementation.

◆ GetHeadphoneJackInterface_()

virtual HeadphoneJackInterface* CYIAbstractVideoPlayer::GetHeadphoneJackInterface_ ( ) const
protectedvirtual

Subclasses may implement this function to provide a headphone jack interface. By default this returns null.

Reimplemented in CYIExoPlayerVideoPlayer.

◆ GetLiveSeekableRanges()

std::vector<SeekableRange> CYIAbstractVideoPlayer::GetLiveSeekableRanges ( ) const

Returns the seekable time ranges of the current stream. Only available for live streams.

Note
Depending on the stream, there is no guarantee that the time ranges will be continuous.
If the seekable time ranges of a live stream are unknown, then an empty vector will be returned.

◆ GetLiveSeekableRanges_()

virtual std::vector<SeekableRange> CYIAbstractVideoPlayer::GetLiveSeekableRanges_ ( ) const
protectedpure virtual

Subclasses must implement this function to report the live seekable ranges.

See also
GetLiveSeekableRanges

Implemented in CYIExoPlayerVideoPlayer, CYIUWPVideoPlayer, CYIVLCVideoPlayer, and CYIVestelVideoPlayer.

◆ GetMediaPlaybackControlsInterface()

MediaPlaybackControlsInterface* CYIAbstractVideoPlayer::GetMediaPlaybackControlsInterface ( ) const

Returns the media playback controls interface associated with the player. Returns null if the interface is not supported by the current player implementation.

◆ GetMediaPlaybackControlsInterface_()

virtual MediaPlaybackControlsInterface* CYIAbstractVideoPlayer::GetMediaPlaybackControlsInterface_ ( ) const
protectedvirtual

Subclasses may implement this function to provide a media playback control interface. By default this returns null.

Reimplemented in CYIExoPlayerVideoPlayer.

◆ GetName()

CYIString CYIAbstractVideoPlayer::GetName ( ) const

Returns the name of the player.

◆ GetName_()

virtual CYIString CYIAbstractVideoPlayer::GetName_ ( ) const
protectedvirtual

◆ GetPlayerState()

CYIAbstractVideoPlayer::PlayerState CYIAbstractVideoPlayer::GetPlayerState ( ) const

Returns the current state of the player.

See also
CYIVideoPlayerStateManager

◆ GetRequestedInitialPlaybackState()

CYIAbstractVideoPlayer::PlaybackState CYIAbstractVideoPlayer::GetRequestedInitialPlaybackState ( ) const
protected

Returns the initial playback state requested when media was loaded with Prepare().

◆ GetStatistics()

Statistics CYIAbstractVideoPlayer::GetStatistics ( ) const

Returns the latest statistics from the player.

◆ GetStatistics_()

virtual Statistics CYIAbstractVideoPlayer::GetStatistics_ ( ) const
protectedvirtual

Returns the latest statistics from the player.

Reimplemented in CYICastLabsVideoPlayer, CYIExoPlayerVideoPlayer, CYIVLCVideoPlayer, CYIUWPVideoPlayer, and CYIVestelVideoPlayer.

◆ GetSurface()

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.

◆ GetTimedMetadataInterface()

TimedMetadataInterface* CYIAbstractVideoPlayer::GetTimedMetadataInterface ( ) const

Returns the timed metadata interface associated with the player. Returns null if the interface is not supported by the current player implementation.

◆ GetTimedMetadataInterface_()

virtual TimedMetadataInterface* CYIAbstractVideoPlayer::GetTimedMetadataInterface_ ( ) const
protectedvirtual

Subclasses may implement this function to provide a timed metadata interface. By default this returns null.

Reimplemented in CYICastLabsVideoPlayer, CYIExoPlayerVideoPlayer, and CYIUWPVideoPlayer.

◆ GetVersion()

CYIString CYIAbstractVideoPlayer::GetVersion ( ) const

Returns the version of the player.

Note
The default implementation simply returns the version of the Engine.
See also
CYIVersion::GetVersionString

◆ GetVersion_()

virtual CYIString CYIAbstractVideoPlayer::GetVersion_ ( ) const
protectedvirtual

Returns the version of the player.

Note
The default implementation simply returns the version of You.i Engine.

Reimplemented in CYIExoPlayerVideoPlayer, CYIUWPVideoPlayer, and CYIVestelVideoPlayer.

◆ GetVideoMaterial()

const std::shared_ptr<CYIMaterial>& CYIAbstractVideoPlayer::GetVideoMaterial ( ) const
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.

◆ GetVideoRequestHTTPHeadersInterface()

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.

◆ GetVideoRequestHTTPHeadersInterface_()

virtual VideoRequestHTTPHeadersInterface* CYIAbstractVideoPlayer::GetVideoRequestHTTPHeadersInterface_ ( )
protectedvirtual

Subclasses may implement this function to provide a custom video request HTTP headers interface. By default this returns null.

Reimplemented in CYICastLabsVideoPlayer.

◆ HasNativeBitrateEventHandling_()

virtual bool CYIAbstractVideoPlayer::HasNativeBitrateEventHandling_ ( ) const
protectedvirtual

Sublclasses 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.

Reimplemented in CYIExoPlayerVideoPlayer.

◆ HasNativeSeekEventHandling_()

virtual bool CYIAbstractVideoPlayer::HasNativeSeekEventHandling_ ( ) const
protectedvirtual

Sublclasses 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.

See also
NotifySeekCompleted

Reimplemented in CYIExoPlayerVideoPlayer, and CYIUWPVideoPlayer.

◆ HasNativeStartTimeHandling_()

virtual bool CYIAbstractVideoPlayer::HasNativeStartTimeHandling_ ( ) const
protectedvirtual

Sublclasses 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.

Reimplemented in CYIExoPlayerVideoPlayer.

◆ Init()

void CYIAbstractVideoPlayer::Init ( )

Initializes the player and its video surface.

Note
This must be called directly after creating a CYIAbstractVideoPlayer instance and before Prepare().

◆ Init_()

virtual void CYIAbstractVideoPlayer::Init_ ( )
protectedvirtual

◆ IsMuted()

bool CYIAbstractVideoPlayer::IsMuted ( ) const
See also
Mute

◆ IsMuted_()

virtual bool CYIAbstractVideoPlayer::IsMuted_ ( ) const
protectedpure virtual

Subclasses must implement this function, and return true if and only if the player is muted.

See also
Mute

Implemented in CYIExoPlayerVideoPlayer, CYIUWPVideoPlayer, CYIVLCVideoPlayer, and CYIVestelVideoPlayer.

◆ Mute()

void CYIAbstractVideoPlayer::Mute ( bool  mute)

Mute the player, so that no audio is played. By default the player is not muted.

◆ Mute_()

virtual void CYIAbstractVideoPlayer::Mute_ ( bool  mute)
protectedpure virtual

Subclasses must implement this function to mute the player when mute is true, and unmute when mute is false.

Implemented in CYIExoPlayerVideoPlayer, CYIUWPVideoPlayer, CYIVLCVideoPlayer, and CYIVestelVideoPlayer.

◆ OnRefreshDRMConfiguration()

void CYIAbstractVideoPlayer::OnRefreshDRMConfiguration ( )
protected

Called by subclasses when a DRM configuration refresh is needed. It will call the user's RefreshDRMConfigurationCallback, if that callback is set.

◆ Pause()

void CYIAbstractVideoPlayer::Pause ( )

Pauses video playback.

Note
This will assert in a debug build if the player is not in the CYIAbstractVideoPlayer::MediaState::Ready state.

◆ Pause_()

virtual void CYIAbstractVideoPlayer::Pause_ ( )
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:

m_pStateManager->TransitionToPlaybackPaused();
See also
Pause

Implemented in CYIExoPlayerVideoPlayer, CYIUWPVideoPlayer, CYIVLCVideoPlayer, and CYIVestelVideoPlayer.

◆ Play()

void CYIAbstractVideoPlayer::Play ( )

Starts the playback of the prepared video asset, or resumes playback if the player is paused.

Note
This will assert in a debug build if the player is not in the CYIAbstractVideoPlayer::MediaState::Ready state.

◆ Play_()

virtual void CYIAbstractVideoPlayer::Play_ ( )
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:

m_pStateManager->TransitionToPlaybackPlaying();
See also
Play

Implemented in CYIExoPlayerVideoPlayer, CYIUWPVideoPlayer, CYIVLCVideoPlayer, and CYIVestelVideoPlayer.

◆ Prepare() [1/2]

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.

Note
If the player is not in the CYIAbstractVideoPlayer::MediaState::Unloaded state the current video media will be stopped/unloaded before preparing. Init() must be called prior to Prepare().
See also
GetDRMConfiguration

◆ Prepare() [2/2]

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.

See also
Prepare(const CYIUrl &, StreamingFormat, CYIAbstractVideoPlayer::PlaybackState, std::unique_ptr<DRMConfiguration>, uint64_t)

◆ Prepare_()

virtual void CYIAbstractVideoPlayer::Prepare_ ( const CYIUrl videoURI,
StreamingFormat  format 
)
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:

m_pStateManager->TransitionToMediaPreparing();

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:

m_pStateManager->TransitionToMediaReady();

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.

See also
Prepare

Implemented in CYIExoPlayerVideoPlayer, CYIUWPVideoPlayer, and CYIVestelVideoPlayer.

◆ Seek()

void CYIAbstractVideoPlayer::Seek ( uint64_t  seekPositionMs)

Seek to seekPositionMs in the video, in milliseconds.

Note
This will assert in a debug build if the player is not in the CYIAbstractVideoPlayer::MediaState::Ready state.

◆ Seek_()

virtual void CYIAbstractVideoPlayer::Seek_ ( uint64_t  seekPositionMS)
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.

See also
Seek

Implemented in CYIExoPlayerVideoPlayer, CYIUWPVideoPlayer, CYIVLCVideoPlayer, and CYIVestelVideoPlayer.

◆ SelectAudioTrack()

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.

◆ SelectAudioTrack_()

virtual bool CYIAbstractVideoPlayer::SelectAudioTrack_ ( uint32_t  id)
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.

See also
GetAudioTracks_
SelectAudioTrack

Implemented in CYIExoPlayerVideoPlayer, CYIUWPVideoPlayer, CYIVLCVideoPlayer, and CYIVestelVideoPlayer.

◆ SelectClosedCaptionsTrack()

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.

See also
AreClosedCaptionsTracksAvailable
AvailableClosedCaptionsTracksChanged

◆ SelectClosedCaptionsTrack_()

virtual bool CYIAbstractVideoPlayer::SelectClosedCaptionsTrack_ ( uint32_t  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.

See also
GetClosedCaptionsTracks_
SelectClosedCaptionsTrack

Implemented in CYIExoPlayerVideoPlayer, CYIUWPVideoPlayer, CYIVLCVideoPlayer, and CYIVestelVideoPlayer.

◆ SetClosedCaptionsEnabled()

void CYIAbstractVideoPlayer::SetClosedCaptionsEnabled ( bool  enabled)

Enables or disables closed captioning.

Note
Calling SelectClosedCaptionsTrack while captions are disabled will also enable closed captions.
See also
SelectClosedCaptionsTrack

◆ SetMaxBitrate()

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.

Note
Setting the maximum bitrate during playback may take time to take effect due to content that has already been buffered.
For the Tizen platform max bitrate must be set before preparing the media.
Setting maxBitrate to 0 will remove any bitrate restrictions.

◆ SetMaxBitrate_()

virtual void CYIAbstractVideoPlayer::SetMaxBitrate_ ( uint64_t  maxBitrate)
protectedvirtual

Subclasses may implement this function to set the maximum bitrate, in bits per second, which an adaptive media source will reach.

Reimplemented in CYIExoPlayerVideoPlayer, CYIUWPVideoPlayer, and CYIVestelVideoPlayer.

◆ SetRefreshDRMConfigurationCallback()

void CYIAbstractVideoPlayer::SetRefreshDRMConfigurationCallback ( RefreshDRMConfigurationCallback  callback)

◆ SetUserAgent()

void CYIAbstractVideoPlayer::SetUserAgent ( const CYIString userAgent)

Set the user agent to be used by the player for requests on manifests and video segments.

Note
Setting the User Agent should be done before a call to Prepare. Otherwise it might have no effect on current playback.
The default User Agent will vary depending on the platform.
Setting the User Agent to empty string "" will reset it to the default.
Only implemented on PS4, XBoxOne, Tizen-Nacl, Bluesky, Windows, Linux and Android currently.

◆ SetUserAgent_()

virtual void CYIAbstractVideoPlayer::SetUserAgent_ ( const CYIString userAgent)
protectedvirtual

Subclasses may implement this function to set the user agent.

Reimplemented in CYIExoPlayerVideoPlayer, CYIUWPVideoPlayer, CYIVLCVideoPlayer, and CYIVestelVideoPlayer.

◆ SetVideoMetadata()

void CYIAbstractVideoPlayer::SetVideoMetadata ( const CYIAbstractVideoPlayer::VideoMetadata metadata)

◆ SetVideoMetadata_()

virtual void CYIAbstractVideoPlayer::SetVideoMetadata_ ( const CYIAbstractVideoPlayer::VideoMetadata metadata)
protectedvirtual

Subclasses should implement this to set video metadata if required by the player.

◆ SetVideoSurfaceSize()

void CYIAbstractVideoPlayer::SetVideoSurfaceSize ( const glm::ivec2 &  size)
protected

Sets the video surface size, in pixels.

◆ Stop()

void CYIAbstractVideoPlayer::Stop ( )

Stops the video playback. This will unload the current video and set the player into the CYIAbstractVideoPlayer::MediaState::Unloaded state.

◆ Stop_()

virtual void CYIAbstractVideoPlayer::Stop_ ( )
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.

See also
Stop

Implemented in CYIExoPlayerVideoPlayer, CYIVLCVideoPlayer, CYIUWPVideoPlayer, and CYIVestelVideoPlayer.

◆ SupportsFormat()

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.

◆ SupportsFormat_()

virtual bool CYIAbstractVideoPlayer::SupportsFormat_ ( StreamingFormat  streamingFormat,
DRMScheme  drmScheme = DRMScheme::None 
) const
protectedpure virtual

Subclasses must implement this function to indicate that they support a given format.

See also
SupportsFormat

Implemented in CYIExoPlayerVideoPlayer, CYIUWPVideoPlayer, and CYIVestelVideoPlayer.

◆ UpdateCurrentTime()

void CYIAbstractVideoPlayer::UpdateCurrentTime ( )
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.

Friends And Related Function Documentation

◆ CYIVideoPlayerStateManager

friend class CYIVideoPlayerStateManager
friend

◆ TimeUpdater

friend class TimeUpdater
friend

Member Data Documentation

◆ AudioBitrateChanged

CYISignal<float> CYIAbstractVideoPlayer::AudioBitrateChanged

Signals that the audio bitrate has changed. This may be emitted at any point.

◆ AvailableAudioTracksChanged

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.

◆ AvailableClosedCaptionsTracksChanged

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.

◆ BufferingEnded

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.

See also
BufferingStarted

◆ BufferingStarted

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.

See also
BufferingEnded

◆ CurrentTimeUpdated

CYISignal<uint64_t> CYIAbstractVideoPlayer::CurrentTimeUpdated

Signals that the current time in the video playback has updated.

See also
GetCurrentTimeMs()

◆ DurationChanged

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.

Note
In most cases GetDurationMs() will only be valid after this signal is emitted for the current video media.

◆ ErrorOccurred

CYISignal<Error> CYIAbstractVideoPlayer::ErrorOccurred

Player reported an error. An application can display an error notification his signal is emitted.

Note
Prior to receiving this signal the player will have transitioned into the CYIAbstractVideoPlayer::MediaState::Unloaded state.

◆ Finalized

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().

Note
If player deletion or state change are intended in this callback, the handler has to be connected using EYIConnectionType::Async.

◆ m_initialStartTimeMs

uint64_t CYIAbstractVideoPlayer::m_initialStartTimeMs
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.

◆ m_maxBitrate

uint64_t CYIAbstractVideoPlayer::m_maxBitrate
protected

The last known maximum bitrate.

◆ m_pClosedCaptionsDispatcher

std::unique_ptr<CYIClosedCaptionsDispatcher> CYIAbstractVideoPlayer::m_pClosedCaptionsDispatcher
protected

The closed captions dispatcher of this player. This is used to dispatch closed caption cues to the surface view's rendering scene node.

Note
Not all player implementations require a closed captions dispatcher. Only players which do not do their own rendering require a dispatcher.
Concrete implementations of this class which require a closed captions dispatcher must assign an instance of CYIClosedCaptionsDispatcher to this variable.
See also
GetClosedCaptionsDispatcher()

◆ m_pDRMConfiguration

std::unique_ptr<DRMConfiguration> CYIAbstractVideoPlayer::m_pDRMConfiguration
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.

Note
This configuration will be null when the media is not DRM protected.

◆ m_pStateManager

std::unique_ptr<CYIVideoPlayerStateManager> CYIAbstractVideoPlayer::m_pStateManager
protected

The CYIAbstractVideoPlayer's instance of the CYIVideoPlayerStateManager. This is used to manage media and state transitions within the player.

Note
Subclasses must report media and player state changes to this manager. Failing to report state changes following the guidelines presented in CYIVideoPlayerStateManager will prevent the video player from functioning.
See also
CYIVideoPlayerStateManager

◆ m_refreshDRMConfigurationCallback

RefreshDRMConfigurationCallback CYIAbstractVideoPlayer::m_refreshDRMConfigurationCallback
protected

Called by the player when a new DRM configuration may be needed.

◆ NotifyDurationChanged

CYISignal<uint64_t> CYIAbstractVideoPlayer::NotifyDurationChanged
protected

Notifies the CYIAbstractVideoPlayer that the duration of the current video media has changed. This typically only occurs when the media is changed.

Note
The CYIAbstractVideoPlayer listens for this signal, subclasses must emit this signal to properly handle video media duration changes.

◆ NotifyErrorOccurred

CYISignal<Error> CYIAbstractVideoPlayer::NotifyErrorOccurred
protected

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.

Note
The CYIAbstractVideoPlayer listens for this signal, subclasses must emit this signal to achieve proper error handling in the CYIAbstractVideoPlayer.

◆ NotifyPlaybackComplete

CYISignal CYIAbstractVideoPlayer::NotifyPlaybackComplete
protected

Notifies the CYIAbstractVideoPlayer that the video has reached the end of stream for the current video media.

Note
The CYIAbstractVideoPlayer listens for this signal, subclasses must emit this signal to properly handle the event where the current video media has played for the entire duration of the stream.

◆ NotifySeekCompleted

CYISignal<bool, uint64_t> CYIAbstractVideoPlayer::NotifySeekCompleted
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.

See also
HasNativeSeekEventHandling_

◆ Paused

CYISignal CYIAbstractVideoPlayer::Paused

Signals that playback has paused. After this signal is emitted the player will be in the CYIAbstractVideoPlayer::PlaybackState::Paused state.

◆ PlaybackComplete

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.

Note
It is possible to transition back into the CYIAbstractVideoPlayer::PlaybackState::Playing state by using a Seek() operation after this signal is emitted. This signal will be emitted each time the video media reaches the end of stream.

◆ PlayerStateChanged

CYISignal<const CYIAbstractVideoPlayer::PlayerState &> CYIAbstractVideoPlayer::PlayerStateChanged

Signals that the internal player state has changed.

◆ Playing

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.

◆ Preparing

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.

◆ Ready

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.

◆ SeekCompleted

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, the second parameter is the playback position after the seek completed in milliseconds, and the third parameter is the position before the seek in milliseconds.

◆ TotalBitrateChanged

CYISignal<float> CYIAbstractVideoPlayer::TotalBitrateChanged

Signals that the combined video and audio bitrate has changed. This may be emitted at any point.

◆ VideoBitrateChanged

CYISignal<float> CYIAbstractVideoPlayer::VideoBitrateChanged

Signals that the video bitrate has changed. This may be emitted at any point.


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