You.i Engine
CYIRokuVideoPlayer Class Reference

#include <player/YiRokuVideoPlayer.h>

Inheritance diagram for CYIRokuVideoPlayer:

Public Member Functions

 CYIRokuVideoPlayer ()
 
virtual ~CYIRokuVideoPlayer ()
 
virtual CYIString GetName_ () const override
 
virtual CYIString GetVersion_ () const override
 
virtual CYIAbstractVideoPlayer::Statistics GetStatistics_ () const override
 
virtual std::unique_ptr< CYIVideoSurfaceCreateSurface_ () override
 
virtual bool SupportsFormat_ (STREAMING_FORMAT eFormat, DRM_SCHEME eDRMScheme) const override
 
virtual void Prepare_ (const CYIUrl &videoURI, CYIAbstractVideoPlayer::STREAMING_FORMAT eFormat) override
 
virtual void Play_ () override
 
virtual void Pause_ () override
 
virtual void Stop_ () override
 
virtual void Seek_ (uint64_t uSeekPositionMS) override
 
virtual uint64_t GetDurationMs_ () const override
 
virtual uint64_t GetCurrentTimeMs_ () const override
 
virtual bool IsMuted_ () const override
 
virtual void Mute_ (bool bMute) override
 
virtual bool SelectAudioTrack_ (uint32_t uID) override
 
virtual std::vector< AudioTrackInfoGetAudioTracks_ () const override
 
virtual CYIAbstractVideoPlayer::AudioTrackInfo GetActiveAudioTrack_ () const override
 
virtual void DisableClosedCaptions_ () override
 
virtual bool SelectClosedCaptionsTrack_ (uint32_t uID) override
 
virtual std::vector< ClosedCaptionsTrackInfoGetClosedCaptionsTracks_ () const override
 
virtual CYIAbstractVideoPlayer::ClosedCaptionsTrackInfo GetActiveClosedCaptionsTrack_ () const override
 
virtual void SetMaxBitrate_ (uint64_t uMaxBitrate) override
 
virtual void OnCueEntered_ (CYIString textInput)
 
- Public Member Functions inherited from CYIAbstractVideoPlayer
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
 

Friends

class CYIRokuVideoPlayerPriv
 

Additional Inherited Members

- Public Types inherited from CYIAbstractVideoPlayer
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 Attributes inherited from CYIAbstractVideoPlayer
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 inherited from CYIAbstractVideoPlayer
 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 inherited from CYIAbstractVideoPlayer
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
 

Constructor & Destructor Documentation

CYIRokuVideoPlayer::CYIRokuVideoPlayer ( )
virtual CYIRokuVideoPlayer::~CYIRokuVideoPlayer ( )
virtual

Member Function Documentation

virtual std::unique_ptr<CYIVideoSurface> CYIRokuVideoPlayer::CreateSurface_ ( )
overridevirtual
virtual void CYIRokuVideoPlayer::DisableClosedCaptions_ ( )
overridevirtual

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.

Implements CYIAbstractVideoPlayer.

virtual CYIAbstractVideoPlayer::AudioTrackInfo CYIRokuVideoPlayer::GetActiveAudioTrack_ ( ) const
overridevirtual

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

Implements CYIAbstractVideoPlayer.

virtual CYIAbstractVideoPlayer::ClosedCaptionsTrackInfo CYIRokuVideoPlayer::GetActiveClosedCaptionsTrack_ ( ) const
overridevirtual

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

Implements CYIAbstractVideoPlayer.

virtual std::vector<AudioTrackInfo> CYIRokuVideoPlayer::GetAudioTracks_ ( ) const
overridevirtual

Subclasses must implement this function to return a vector of available audio tracks for the currently loaded media.

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

Implements CYIAbstractVideoPlayer.

virtual std::vector<ClosedCaptionsTrackInfo> CYIRokuVideoPlayer::GetClosedCaptionsTracks_ ( ) const
overridevirtual

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

Implements CYIAbstractVideoPlayer.

virtual uint64_t CYIRokuVideoPlayer::GetCurrentTimeMs_ ( ) const
overridevirtual

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

See also
GetCurrentTimeMs

Implements CYIAbstractVideoPlayer.

virtual uint64_t CYIRokuVideoPlayer::GetDurationMs_ ( ) const
overridevirtual

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

See also
GetDurationMs

Implements CYIAbstractVideoPlayer.

virtual CYIString CYIRokuVideoPlayer::GetName_ ( ) const
overridevirtual

Returns the name of the player.

Reimplemented from CYIAbstractVideoPlayer.

virtual CYIAbstractVideoPlayer::Statistics CYIRokuVideoPlayer::GetStatistics_ ( ) const
overridevirtual

Returns the latest statistics from the player.

Reimplemented from CYIAbstractVideoPlayer.

virtual CYIString CYIRokuVideoPlayer::GetVersion_ ( ) const
overridevirtual

Returns the version of the player.

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

Reimplemented from CYIAbstractVideoPlayer.

virtual bool CYIRokuVideoPlayer::IsMuted_ ( ) const
overridevirtual

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

See also
Mute

Implements CYIAbstractVideoPlayer.

virtual void CYIRokuVideoPlayer::Mute_ ( bool  bMute)
overridevirtual

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

Implements CYIAbstractVideoPlayer.

virtual void CYIRokuVideoPlayer::OnCueEntered_ ( CYIString  textInput)
virtual
virtual void CYIRokuVideoPlayer::Pause_ ( )
overridevirtual

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::PLAYBACK_PAUSED state as follows:

m_pStateManager->TransitionToPlaybackPaused();
See also
Pause

Implements CYIAbstractVideoPlayer.

virtual void CYIRokuVideoPlayer::Play_ ( )
overridevirtual

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::PLAYBACK_PLAYING state as follows:

m_pStateManager->TransitionToPlaybackPlaying();
See also
Play

Implements CYIAbstractVideoPlayer.

virtual void CYIRokuVideoPlayer::Prepare_ ( const CYIUrl videoURI,
CYIAbstractVideoPlayer::STREAMING_FORMAT  eFormat 
)
overridevirtual

Subclasses must implement this function to prepare the video.

When a video is preparing, the player must be transitioned into the CYIAbstractVideoPlayer::MEDIA_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::MEDIA_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

Implements CYIAbstractVideoPlayer.

virtual void CYIRokuVideoPlayer::Seek_ ( uint64_t  uSeekPositionMS)
overridevirtual

Subclasses must implement this function to seek the video to a specific uSeekPositionMS in the video media. When seeking backwards from playback complete, the player must remain paused.

See also
Seek

Implements CYIAbstractVideoPlayer.

virtual bool CYIRokuVideoPlayer::SelectAudioTrack_ ( uint32_t  uID)
overridevirtual

Subclasses must implement this function to switch the video player's current audio track to the one referenced by uID.

CYIAbstractVideoPlayer::SelectAudioTrack will validate the id prior to this function being called.

See also
GetAudioTracks_
SelectAudioTrack

Implements CYIAbstractVideoPlayer.

virtual bool CYIRokuVideoPlayer::SelectClosedCaptionsTrack_ ( uint32_t  uID)
overridevirtual

Subclasses must implement this function to switch the video player's current closed captions track to the one referenced by uID. 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, uID is guaranteed not to be ClosedCaptionsTrackInfo::OFF_TRACK_ID.

See also
GetClosedCaptionsTracks_
SelectClosedCaptionsTrack

Implements CYIAbstractVideoPlayer.

virtual void CYIRokuVideoPlayer::SetMaxBitrate_ ( uint64_t  uMaxBitrate)
overridevirtual

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

Reimplemented from CYIAbstractVideoPlayer.

virtual void CYIRokuVideoPlayer::Stop_ ( )
overridevirtual

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::MEDIA_UNLOADED after this function executes.

See also
Stop

Implements CYIAbstractVideoPlayer.

virtual bool CYIRokuVideoPlayer::SupportsFormat_ ( STREAMING_FORMAT  eStreamingFormat,
DRM_SCHEME  eDRMScheme 
) const
overridevirtual

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

See also
SupportsFormat

Implements CYIAbstractVideoPlayer.

Friends And Related Function Documentation

friend class CYIRokuVideoPlayerPriv
friend

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