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
 
struct  ClosedCaptionsTrackInfo
 
class  DRMConfiguration
 The base class for all DRM configurations. More...
 
struct  Error
 
struct  PlayerState
 
struct  Statistics
 
struct  TrackInfo
 

Public Types

enum  MEDIA_STATE {
  MEDIA_UNLOADED,
  MEDIA_PREPARING,
  MEDIA_READY
}
 
enum  PLAYBACK_STATE {
  PLAYBACK_PLAYING,
  PLAYBACK_PAUSED,
  PLAYBACK_BUFFERING
}
 
enum  STREAMING_FORMAT {
  HLS = 0,
  SMOOTH,
  DASH,
  MP4
}
 
enum  DRM_SCHEME {
  DRM_NONE = 0,
  DRM_FAIRPLAY,
  DRM_PLAYREADY,
  DRM_WIDEVINE_MODULAR
}
 
enum  ERROR_CODE {
  PLAYBACK_ERROR,
  UNSUPPORTED_FORMAT,
  STATE_TRANSITION_ERROR,
  DRM_ERROR,
  UNKNOWN
}
 
using VideoMetadata = std::map< CYIString, CYIString >
 

Public Member Functions

virtual ~CYIAbstractVideoPlayer ()
 
CYIString GetName () const
 
CYIString GetVersion () const
 
Statistics GetStatistics () const
 
void Init ()
 
void Prepare (const CYIUrl &videoURI, STREAMING_FORMAT eFormatHint, CYIAbstractVideoPlayer::PLAYBACK_STATE eInitialState=CYIAbstractVideoPlayer::PLAYBACK_PAUSED, std::unique_ptr< DRMConfiguration > pDRMConfiguration=nullptr)
 
void Prepare (const std::shared_ptr< CYIAssetVideo > &videoAsset, STREAMING_FORMAT eFormatHint, CYIAbstractVideoPlayer::PLAYBACK_STATE eInitialState=CYIAbstractVideoPlayer::PLAYBACK_PAUSED, std::unique_ptr< DRMConfiguration > pDRMConfiguration=nullptr)
 
void Play ()
 
void Pause ()
 
void Stop ()
 
void Seek (uint64_t uSeekPositionMs)
 
bool SupportsFormat (STREAMING_FORMAT eStreamingFormat, DRM_SCHEME eDRMScheme=DRM_NONE)
 
uint64_t GetDurationMs () const
 
uint64_t GetCurrentTimeMs () const
 
CYIAbstractVideoPlayer::PlayerState GetPlayerState () const
 
bool AreClosedCaptionsTracksAvailable () const
 
bool SelectClosedCaptionsTrack (uint32_t uID)
 
std::vector< ClosedCaptionsTrackInfoGetClosedCaptionsTracks () const
 
ClosedCaptionsTrackInfo GetActiveClosedCaptionsTrack () const
 
CYIClosedCaptionsDispatcherGetClosedCaptionsDispatcher () const
 
CYIVideoSurfaceGetSurface () const
 
bool AreAudioTracksAvailable () const
 
bool SelectAudioTrack (uint32_t uID)
 
std::vector< AudioTrackInfoGetAudioTracks () const
 
AudioTrackInfo GetActiveAudioTrack () const
 
bool IsMuted () const
 
void Mute (bool bMute)
 
void SetMaxBitrate (uint64_t uMaxBitrate)
 
void SetUserAgent (const CYIString &userAgent)
 
void SetVideoMetadata (const CYIAbstractVideoPlayer::VideoMetadata &metadata)
 
const DRMConfigurationGetDRMConfiguration () const
 
DRMConfigurationGetDRMConfiguration ()
 
- 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 Member Functions inherited from CYIScriptableObject
 CYIScriptableObject ()
 
 CYIScriptableObject (const CYIScriptableObject &other)
 
CYIScriptableObjectoperator= (const CYIScriptableObject &other)
 
virtual ~CYIScriptableObject ()
 
CYIBindingImplementationGetBindingImplementation () const
 
void SetBindingImplementation (CYIBindingImplementation *pBindingImplementation)
 
virtual const CYIRuntimeTypeInfoGetRuntimeTypeInfoForScriptObject () const
 

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< const CYIAbstractVideoPlayer::PlayerState & > PlayerStateChanged
 
CYISignal< std::vector< AudioTrackInfo > > AvailableAudioTracksChanged
 
CYISignal< std::vector< ClosedCaptionsTrackInfo > > AvailableClosedCaptionsTracksChanged
 

Protected Member Functions

 CYIAbstractVideoPlayer ()
 
const std::shared_ptr< CYIMaterial > & GetVideoMaterial () const
 
void SetVideoSurfaceSize (const glm::ivec2 &size)
 
void ChangeInitialPlaybackState (CYIAbstractVideoPlayer::PLAYBACK_STATE eInitialState)
 
CYIAbstractVideoPlayer::PLAYBACK_STATE GetRequestedInitialPlaybackState () const
 
void CheckAndNotifyMediaTracksChanged ()
 
void UpdateCurrentTime ()
 

Protected Attributes

CYISignal< ErrorNotifyErrorOccurred
 
CYISignal NotifyPlaybackComplete
 
CYISignal< uint64_t > NotifyDurationChanged
 
std::unique_ptr< CYIVideoPlayerStateManagerm_pStateManager
 
std::unique_ptr< CYIClosedCaptionsDispatcherm_pClosedCaptionsDispatcher
 
std::shared_ptr< DRMConfigurationm_pDRMConfiguration
 
uint64_t m_uMaxBitrate
 

Friends

class CYIVideoPlayerStateManager
 
class TimeUpdater
 

Member Typedef Documentation

Alias type for metadata associated with video.

See also
CYIAbstractVideoPlayer::SetVideoMetadata

Member Enumeration Documentation

Enumeration of available DRM schemes.

See also
SupportsFormat()
Enumerator
DRM_NONE 
DRM_FAIRPLAY 
DRM_PLAYREADY 
DRM_WIDEVINE_MODULAR 

Enumeration of the possible errors which the player can emit.

See also
CYIAbstractVideoPlayer::ErrorOccurred
Enumerator
PLAYBACK_ERROR 

Indicates that an error occurred during playback of the video media. This may occur at anytime which the media state is not CYIAbstractVideoPlayer::MEDIA_UNLOADED.

UNSUPPORTED_FORMAT 

Indicates that the combination of eFormatHint and pDRMConfiguration provided to Prepare() is not supported by the current player/platform.

STATE_TRANSITION_ERROR 

Indicates that the player has transitioned into an invalid state.

See also
CYIVideoPlayerStateManager
DRM_ERROR 
UNKNOWN 

< Indicates that an error occured when attempting to process DRM protected content. Indicates that an unknown error has occurred in the player.

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

See also
GetPlayerState()
CYIVideoPlayerStateManager
Enumerator
MEDIA_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()
MEDIA_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
MEDIA_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::PLAYBACK_STATE.

See also
CYIAbstractVideoPlayer::Ready

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::MEDIA_READY.

See also
GetPlayerState()
CYIVideoPlayerStateManager
Enumerator
PLAYBACK_PLAYING 

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

See also
Play()
CYIAbstractVideoPlayer::Playing
PLAYBACK_PAUSED 

Represents that the video player is currently paused.

See also
Pause()
CYIAbstractVideoPlayer::Paused
PLAYBACK_BUFFERING 

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

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

Enumeration of available video media streaming formats.

See also
SupportsFormat()
Enumerator
HLS 
SMOOTH 
DASH 
MP4 

Constructor & Destructor Documentation

virtual CYIAbstractVideoPlayer::~CYIAbstractVideoPlayer ( )
virtual
CYIAbstractVideoPlayer::CYIAbstractVideoPlayer ( )
protected

Member Function Documentation

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
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
void CYIAbstractVideoPlayer::ChangeInitialPlaybackState ( CYIAbstractVideoPlayer::PLAYBACK_STATE  eInitialState)
protected

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

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

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::bIsValid set to false.

See also
AreAudioTracksAvailable
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::uID of ClosedCaptionsTrackInfo::OFF_TRACK_ID.

See also
AreClosedCaptionsTracksAvailable
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
CYIClosedCaptionsDispatcher* CYIAbstractVideoPlayer::GetClosedCaptionsDispatcher ( ) 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.

See also
SelectClosedCaptionsTrack
AreClosedCaptionsTracksAvailable
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.

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
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
uint64_t CYIAbstractVideoPlayer::GetDurationMs ( ) const

Returns the duration of the video in milliseconds. Returns 0 if the player is in the CYIAbstractVideoPlayer::MEDIA_UNLOADED state.

CYIString CYIAbstractVideoPlayer::GetName ( ) const

Returns the name of the player.

CYIAbstractVideoPlayer::PlayerState CYIAbstractVideoPlayer::GetPlayerState ( ) const

Returns the current state of the player.

See also
CYIVideoPlayerStateManager
CYIAbstractVideoPlayer::PLAYBACK_STATE CYIAbstractVideoPlayer::GetRequestedInitialPlaybackState ( ) const
protected

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

Statistics CYIAbstractVideoPlayer::GetStatistics ( ) const

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.

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

void CYIAbstractVideoPlayer::Init ( )

Initializes the player and its video surface.

Note
This must be called directly after creating a CYIAbstractVideoPlayer instance and before Prepare().
bool CYIAbstractVideoPlayer::IsMuted ( ) const
See also
Mute
void CYIAbstractVideoPlayer::Mute ( bool  bMute)

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

void CYIAbstractVideoPlayer::Pause ( )

Pauses video playback.

Note
This will assert in a debug build if the player is not in the CYIAbstractVideoPlayer::MEDIA_READY state.
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::MEDIA_READY state.
void CYIAbstractVideoPlayer::Prepare ( const CYIUrl videoURI,
STREAMING_FORMAT  eFormatHint,
CYIAbstractVideoPlayer::PLAYBACK_STATE  eInitialState = CYIAbstractVideoPlayer::PLAYBACK_PAUSED,
std::unique_ptr< DRMConfiguration pDRMConfiguration = nullptr 
)

Prepares the player with the provided video file at videoURI.

The eFormatHint 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::UNSUPPORTED_FORMAT 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 the prepare operation was successful the player will transition into the CYIAbstractVideoPlayer::MEDIA_READY state. eInitialState represents the state the player will be in after Prepare() completes.

Note
If the player is not in the CYIAbstractVideoPlayer::MEDIA_UNLOADED state the current video media will be stopped/unloaded before preparing. Init() must be called prior to Prepare().
See also
GetDRMConfiguration
void CYIAbstractVideoPlayer::Prepare ( const std::shared_ptr< CYIAssetVideo > &  videoAsset,
STREAMING_FORMAT  eFormatHint,
CYIAbstractVideoPlayer::PLAYBACK_STATE  eInitialState = CYIAbstractVideoPlayer::PLAYBACK_PAUSED,
std::unique_ptr< DRMConfiguration pDRMConfiguration = nullptr 
)

Prepares the player with the provided video file at videoAsset. If videoAsset is null, an error will be reported.

See also
Prepare(const CYIUrl &, STREAMING_FORMAT, CYIAbstractVideoPlayer::PLAYBACK_STATE, std::shared_ptr<DRMConfiguration>)
void CYIAbstractVideoPlayer::Seek ( uint64_t  uSeekPositionMs)

Seek to uSeekPositionMs in the video, in milliseconds.

Note
This will assert in a debug build if the player is not in the CYIAbstractVideoPlayer::MEDIA_READY state.
bool CYIAbstractVideoPlayer::SelectAudioTrack ( uint32_t  uID)

Switches the video player's audio to the track indicated by the given uID.

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 uID is available.

bool CYIAbstractVideoPlayer::SelectClosedCaptionsTrack ( uint32_t  uID)

Switches the video player's closed captions track to the track indicated by the given uID.

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 uID is available, or if uID is not ClosedCaptionsTrackInfo::OFF_TRACK_ID.

See also
AreClosedCaptionsTracksAvailable
AvailableClosedCaptionsTracksChanged
void CYIAbstractVideoPlayer::SetMaxBitrate ( uint64_t  uMaxBitrate)

Sets the maximum bitrate to uMaxBitrate, 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 uMaxBitrate to 0 will remove any bitrate restrictions.
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 and XBoxOne currently.
void CYIAbstractVideoPlayer::SetVideoMetadata ( const CYIAbstractVideoPlayer::VideoMetadata metadata)
void CYIAbstractVideoPlayer::SetVideoSurfaceSize ( const glm::ivec2 &  size)
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::MEDIA_UNLOADED state.

bool CYIAbstractVideoPlayer::SupportsFormat ( STREAMING_FORMAT  eStreamingFormat,
DRM_SCHEME  eDRMScheme = DRM_NONE 
)

Query the player to determine if eStreamingFormat and eDRMScheme combination is supported by the player. Returns true if the provided format and DRM scheme combination is supported by the player.

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

friend class CYIVideoPlayerStateManager
friend
friend class TimeUpdater
friend

Member Data Documentation

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::PLAYBACK_PLAYING or CYIAbstractVideoPlayer::PLAYBACK_PAUSED state depending on the state the player was in prior to entering the CYIAbstractVideoPlayer::PLAYBACK_BUFFERING state.

See also
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::PLAYBACK_BUFFERING state.

See also
BufferingEnded
CYISignal<uint64_t> CYIAbstractVideoPlayer::CurrentTimeUpdated

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

See also
GetCurrentTimeMs()
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.
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::MEDIA_UNLOADED state.
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 recommanded 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 YI_CONNECTION_ASYNC.
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()
std::shared_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.
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
uint64_t CYIAbstractVideoPlayer::m_uMaxBitrate
protected

The last known maximum bitrate.

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.
CYISignal<Error> CYIAbstractVideoPlayer::NotifyErrorOccurred
protected

Notifies the CYIAbstractVideoPlayer that an error has occured, this will transition the player into the CYIAbstractVideoPlayer::MEDIA_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.
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.
CYISignal CYIAbstractVideoPlayer::Paused

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

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::PLAYBACK_PAUSED state.

Note
It is possible to transition back into the CYIAbstractVideoPlayer::PLAYBACK_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.
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::PLAYBACK_PAUSED or CYIAbstractVideoPlayer::PLAYBACK_BUFFERING states. After this signal is emitted the player will be in the CYIAbstractVideoPlayer::PLAYBACK_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::MEDIA_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::MEDIA_READY state.


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