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

class  AdaptiveResolutionInterface
 An interface to adjust playback quality through resolution. More...
 
struct  AudioTrackInfo
 
class  BackgroundPlaybackInterface
 
class  BufferingInterface
 
struct  BufferLength
 
struct  ClosedCaptionsTrackInfo
 
class  DRMConfiguration
 The base class for all DRM configurations. More...
 
struct  Error
 
class  HeadphoneJackInterface
 
class  LiveSessionInterface
 An interface to adjust playback of live streams. More...
 
class  MediaPlaybackControlsInterface
 
class  NetworkTimeoutInterface
 
struct  PlayerState
 
struct  SeekableRange
 
struct  Statistics
 
struct  TimedMetadata
 
struct  TimedMetadataAdditionalDataKeys
 
class  TimedMetadataInterface
 
struct  TrackInfo
 
class  VideoRequestHTTPHeadersInterface
 

Public Types

enum  MediaState {
  MediaState::Unloaded,
  MediaState::Preparing,
  MediaState::Ready
}
 
enum  PlaybackState {
  PlaybackState::Playing,
  PlaybackState::Paused,
  PlaybackState::Buffering
}
 
enum  StreamingFormat {
  StreamingFormat::HLS = 0,
  StreamingFormat::Smooth,
  StreamingFormat::DASH,
  StreamingFormat::MP4
}
 
enum  DRMScheme {
  DRMScheme::None = 0,
  DRMScheme::FairPlay,
  DRMScheme::PlayReady,
  DRMScheme::WidevineModular,
  DRMScheme::WidevineModularCustomRequest
}
 
enum  ErrorCode {
  ErrorCode::PlaybackError,
  ErrorCode::UnsupportedFormat,
  ErrorCode::StateTransitionError,
  ErrorCode::DRMError,
  ErrorCode::InitializationError,
  ErrorCode::Unknown
}
 
using RTTIInstantiatability = CYIRuntimeTypeInfo::NonInstantiableTag
 
using RefreshDRMConfigurationCallback = std::function< std::unique_ptr< CYIAbstractVideoPlayer::DRMConfiguration >(std::unique_ptr< CYIAbstractVideoPlayer::DRMConfiguration >)>
 

Public 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
 
std::shared_ptr< CYIPlatformPlayerHandleGetPlatformPlayerHandle () const
 
std::shared_ptr< CYIPlatformViewHandleGetPlatformPlayerContainerViewHandle () const
 
void SetClosedCaptionsEnabled (bool enabled)
 
bool AreClosedCaptionsTracksAvailable () const
 
bool SelectClosedCaptionsTrack (uint32_t id)
 
std::vector< ClosedCaptionsTrackInfoGetClosedCaptionsTracks () const
 
ClosedCaptionsTrackInfo GetActiveClosedCaptionsTrack () const
 
CYIClosedCaptionsDispatcherGetClosedCaptionsDispatcher () const
 
CYIClosedCaptionsStyleManagerGetClosedCaptionsStyleManager () 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)
 
uint64_t GetMinimumTimeUpdateIntervalMs () const
 
void SetMinimumTimeUpdateIntervalMs (uint64_t minimumTimeUpdateIntervalMs)
 
void SetMaxBitrate (uint64_t maxBitrate)
 
void SetInitialBandwidthHint (uint64_t initialBandwidthHint)
 
void SetUserAgent (const CYIString &userAgent)
 
const DRMConfigurationGetDRMConfiguration () const
 
DRMConfigurationGetDRMConfiguration ()
 
BackgroundPlaybackInterfaceGetBackgroundPlaybackInterface ()
 
const BackgroundPlaybackInterfaceGetBackgroundPlaybackInterface () const
 
HeadphoneJackInterfaceGetHeadphoneJackInterface ()
 
const HeadphoneJackInterfaceGetHeadphoneJackInterface () const
 
BufferingInterfaceGetBufferingInterface ()
 
const BufferingInterfaceGetBufferingInterface () const
 
TimedMetadataInterfaceGetTimedMetadataInterface ()
 
const TimedMetadataInterfaceGetTimedMetadataInterface () const
 
VideoRequestHTTPHeadersInterfaceGetVideoRequestHTTPHeadersInterface ()
 
const VideoRequestHTTPHeadersInterfaceGetVideoRequestHTTPHeadersInterface () const
 
MediaPlaybackControlsInterfaceGetMediaPlaybackControlsInterface ()
 
const MediaPlaybackControlsInterfaceGetMediaPlaybackControlsInterface () const
 
NetworkTimeoutInterfaceGetNetworkTimeoutInterface ()
 
const NetworkTimeoutInterfaceGetNetworkTimeoutInterface () const
 
LiveSessionInterfaceGetLiveSessionInterface ()
 
const LiveSessionInterfaceGetLiveSessionInterface () const
 
AdaptiveResolutionInterfaceGetAdaptiveResolutionInterface ()
 
const AdaptiveResolutionInterfaceGetAdaptiveResolutionInterface () const
 
void SetRefreshDRMConfigurationCallback (RefreshDRMConfigurationCallback callback)
 
- Public Member Functions inherited from CYISignalHandler
 CYISignalHandler ()
 
 CYISignalHandler (const CYISignalHandler &signalHandler)
 
virtual ~CYISignalHandler ()
 
CYISignalHandleroperator= (const CYISignalHandler &signalHandler)
 
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 &threadAffinity)
 
virtual bool IsConnected () const
 
virtual bool IsConnected (const CYISignalBase &signal) const
 
void Disconnect (CYISignalBase &signal)
 
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< std::shared_ptr< CYIPlatformPlayerHandle >, std::shared_ptr< CYIPlatformPlayerHandle > > PlatformPlayerHandleChanged
 
CYISignal< std::shared_ptr< CYIPlatformViewHandle >, std::shared_ptr< CYIPlatformViewHandle > > PlatformPlayerContainerViewHandleChanged
 
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 SetPlatformPlayerHandle (std::shared_ptr< CYIPlatformPlayerHandle > pPlatformPlayerHandle)
 
void SetPlatformPlayerContainerViewHandle (std::shared_ptr< CYIPlatformViewHandle > pPlatformPlayerContainerViewHandle)
 
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 bool HasInitialBandwidthHintHandling_ () 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 const BackgroundPlaybackInterfaceGetBackgroundPlaybackInterface_ () const
 
virtual const HeadphoneJackInterfaceGetHeadphoneJackInterface_ () const
 
virtual const BufferingInterfaceGetBufferingInterface_ () const
 
virtual const TimedMetadataInterfaceGetTimedMetadataInterface_ () const
 
virtual const VideoRequestHTTPHeadersInterfaceGetVideoRequestHTTPHeadersInterface_ () const
 
virtual const MediaPlaybackControlsInterfaceGetMediaPlaybackControlsInterface_ () const
 
virtual const NetworkTimeoutInterfaceGetNetworkTimeoutInterface_ () const
 
virtual const LiveSessionInterfaceGetLiveSessionInterface_ () const
 
virtual const AdaptiveResolutionInterfaceGetAdaptiveResolutionInterface_ () 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< CYIClosedCaptionsStyleManagerm_pStyleManager
 
std::unique_ptr< DRMConfigurationm_pDRMConfiguration
 
uint64_t m_maxBitrate
 
uint64_t m_initialBandwidthHint
 
uint64_t m_initialStartTimeMs
 
RefreshDRMConfigurationCallback m_refreshDRMConfigurationCallback
 

Friends

class CYIVideoPlayerStateManager
 

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

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.

◆ 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

◆ 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

◆ GetAdaptiveResolutionInterface() [1/2]

AdaptiveResolutionInterface* CYIAbstractVideoPlayer::GetAdaptiveResolutionInterface ( )

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

◆ GetAdaptiveResolutionInterface() [2/2]

const AdaptiveResolutionInterface* CYIAbstractVideoPlayer::GetAdaptiveResolutionInterface ( ) const

◆ GetAdaptiveResolutionInterface_()

virtual const AdaptiveResolutionInterface* CYIAbstractVideoPlayer::GetAdaptiveResolutionInterface_ ( ) const
protectedvirtual

Subclasses may implement this function to provide an adaptive playback resolution control interface. By default this returns null.

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

◆ GetBackgroundPlaybackInterface() [1/2]

BackgroundPlaybackInterface* CYIAbstractVideoPlayer::GetBackgroundPlaybackInterface ( )

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

◆ GetBackgroundPlaybackInterface() [2/2]

const BackgroundPlaybackInterface* CYIAbstractVideoPlayer::GetBackgroundPlaybackInterface ( ) const

◆ GetBackgroundPlaybackInterface_()

virtual const BackgroundPlaybackInterface* CYIAbstractVideoPlayer::GetBackgroundPlaybackInterface_ ( ) const
protectedvirtual

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

◆ GetBufferingInterface() [1/2]

BufferingInterface* CYIAbstractVideoPlayer::GetBufferingInterface ( )

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

◆ GetBufferingInterface() [2/2]

const BufferingInterface* CYIAbstractVideoPlayer::GetBufferingInterface ( ) const

◆ GetBufferingInterface_()

virtual const BufferingInterface* CYIAbstractVideoPlayer::GetBufferingInterface_ ( ) const
protectedvirtual

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

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

◆ GetClosedCaptionsStyleManager()

CYIClosedCaptionsStyleManager* CYIAbstractVideoPlayer::GetClosedCaptionsStyleManager ( ) const

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

◆ 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

◆ 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

◆ GetHeadphoneJackInterface() [1/2]

HeadphoneJackInterface* CYIAbstractVideoPlayer::GetHeadphoneJackInterface ( )

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

◆ GetHeadphoneJackInterface() [2/2]

const HeadphoneJackInterface* CYIAbstractVideoPlayer::GetHeadphoneJackInterface ( ) const

◆ GetHeadphoneJackInterface_()

virtual const HeadphoneJackInterface* CYIAbstractVideoPlayer::GetHeadphoneJackInterface_ ( ) const
protectedvirtual

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

◆ 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

◆ GetLiveSessionInterface() [1/2]

LiveSessionInterface* CYIAbstractVideoPlayer::GetLiveSessionInterface ( )

Returns the live session control interface associated with the player. Returns null if the interface is not supported by the current player implementation.

◆ GetLiveSessionInterface() [2/2]

const LiveSessionInterface* CYIAbstractVideoPlayer::GetLiveSessionInterface ( ) const

◆ GetLiveSessionInterface_()

virtual const LiveSessionInterface* CYIAbstractVideoPlayer::GetLiveSessionInterface_ ( ) const
protectedvirtual

Subclasses may implement this function to provide a live session control interface. By default this returns null.

◆ GetMediaPlaybackControlsInterface() [1/2]

MediaPlaybackControlsInterface* CYIAbstractVideoPlayer::GetMediaPlaybackControlsInterface ( )

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

◆ GetMediaPlaybackControlsInterface() [2/2]

const MediaPlaybackControlsInterface* CYIAbstractVideoPlayer::GetMediaPlaybackControlsInterface ( ) const

◆ GetMediaPlaybackControlsInterface_()

virtual const MediaPlaybackControlsInterface* CYIAbstractVideoPlayer::GetMediaPlaybackControlsInterface_ ( ) const
protectedvirtual

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

◆ GetMinimumTimeUpdateIntervalMs()

uint64_t CYIAbstractVideoPlayer::GetMinimumTimeUpdateIntervalMs ( ) const

Returns the minimum current time update interval in milliseconds. The default value is 100 milliseconds.

See also
SetMinimumTimeUpdateIntervalMs
CurrentTimeUpdated

◆ GetName()

CYIString CYIAbstractVideoPlayer::GetName ( ) const

Returns the name of the player.

◆ GetName_()

virtual CYIString CYIAbstractVideoPlayer::GetName_ ( ) const
protectedvirtual

Returns the name of the player.

◆ GetNetworkTimeoutInterface() [1/2]

NetworkTimeoutInterface* CYIAbstractVideoPlayer::GetNetworkTimeoutInterface ( )

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

◆ GetNetworkTimeoutInterface() [2/2]

const NetworkTimeoutInterface* CYIAbstractVideoPlayer::GetNetworkTimeoutInterface ( ) const

◆ GetNetworkTimeoutInterface_()

virtual const NetworkTimeoutInterface* CYIAbstractVideoPlayer::GetNetworkTimeoutInterface_ ( ) const
protectedvirtual

Subclasses may implement this function to provide a network timeout control interface. By default this returns null.

◆ GetPlatformPlayerContainerViewHandle()

std::shared_ptr<CYIPlatformViewHandle> CYIAbstractVideoPlayer::GetPlatformPlayerContainerViewHandle ( ) const

Returns a platform view handle containing the native player container view, if available.

Warning
This must be used with caution as altering the view may result in the concrete player implementation no longer working correctly.
Note
It is recommended to use the PlatformPlayerContainerViewHandleChanged signal to wait for the platform player container view handle to be created if it is not immediately available upon player initialization.
This functionality is only intended for use when integrating with 3rd party advertising frameworks.
Platform view handles are only available on Android, iOS, tvOS and UWP.
See also
PlatformPlayerContainerViewHandleChanged
GetPlatformPlayerHandle

◆ GetPlatformPlayerHandle()

std::shared_ptr<CYIPlatformPlayerHandle> CYIAbstractVideoPlayer::GetPlatformPlayerHandle ( ) const

Returns a platform player handle containing the native player instance, if available.

Warning
This must be used with caution as invoking certain functions of the player instance may interfere with the abstract player implementation, and as such it should be treated exclusively as read-only.
Note
It is recommended to use the PlatformPlayerHandleChanged signal to wait for the platform player handle to be created if it is not immediately available upon player initialization.
This functionality is only intended for use when integrating with 3rd party analytics or advertising frameworks.
Platform player handles are only available on Android, iOS, tvOS and UWP.
See also
PlatformPlayerHandleChanged
GetPlatformPlayerContainerViewHandle

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

◆ 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() [1/2]

TimedMetadataInterface* CYIAbstractVideoPlayer::GetTimedMetadataInterface ( )

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

◆ GetTimedMetadataInterface() [2/2]

const TimedMetadataInterface* CYIAbstractVideoPlayer::GetTimedMetadataInterface ( ) const

◆ GetTimedMetadataInterface_()

virtual const TimedMetadataInterface* CYIAbstractVideoPlayer::GetTimedMetadataInterface_ ( ) const
protectedvirtual

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

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

◆ 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() [1/2]

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() [2/2]

const VideoRequestHTTPHeadersInterface* CYIAbstractVideoPlayer::GetVideoRequestHTTPHeadersInterface ( ) const

◆ GetVideoRequestHTTPHeadersInterface_()

virtual const VideoRequestHTTPHeadersInterface* CYIAbstractVideoPlayer::GetVideoRequestHTTPHeadersInterface_ ( ) const
protectedvirtual

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

◆ HasInitialBandwidthHintHandling_()

virtual bool CYIAbstractVideoPlayer::HasInitialBandwidthHintHandling_ ( ) const
protectedvirtual

Subclasses may implement this function to return true if initial bandwidth hint is handled.

If implemented to return true, the player implementation should use the value m_initialBandwidthHint, set by a call to SetInitialBandwidthHint, to select an initial playback variant with a bitrate suitable for the network bandwidth hint.

See also
SetInitialBandwidthHint

◆ HasNativeBitrateEventHandling_()

virtual bool CYIAbstractVideoPlayer::HasNativeBitrateEventHandling_ ( ) const
protectedvirtual

Subclasses may implement this function to return true if the bitrate changed events are handled by the native implementation. The default implementation returns false.

If implemented to return true, the player implementation should detect changes in audio, video, and total bitrate, and emit the signals VideoBitrateChanged, AudioBitrateChanged, TotalBitrateChanged.

◆ HasNativeSeekEventHandling_()

virtual bool CYIAbstractVideoPlayer::HasNativeSeekEventHandling_ ( ) const
protectedvirtual

Subclasses may implement this function to return true if seek started/completed events are handled by the native implementation. The default implementation returns false.

If implemented to return true, the player implementation should emit NotifySeekCompleted when the seek has finished. When not implemented to return true the default implementation will emit SeekCompleted when the current time updates appropriately.

See also
NotifySeekCompleted

◆ HasNativeStartTimeHandling_()

virtual bool CYIAbstractVideoPlayer::HasNativeStartTimeHandling_ ( ) const
protectedvirtual

Subclasses may implement this function to return true if the start time is handled by the player implementation. The default implementation returns false.

If implemented to return true, the player implementation should use the member m_initialStartTimeMs, which is set when Prepare is called, to set the start time of the asset.

◆ 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

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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ SetInitialBandwidthHint()

void CYIAbstractVideoPlayer::SetInitialBandwidthHint ( uint64_t  initialBandwidthHint)

Sets the initial network bandwidth hint, in bits per second, which the player will use to select a starting bitrate for the video session.

Note
Setting the initial bandwidth hint won't take effect until the next time media is prepared.
Setting initialBandwidthHint to 0 corresponds to no hint set, and the native player will select a starting bitrate using its default logic.

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

◆ SetMinimumTimeUpdateIntervalMs()

void CYIAbstractVideoPlayer::SetMinimumTimeUpdateIntervalMs ( uint64_t  minimumTimeUpdateIntervalMs)

Sets the minimum current time update interval in milliseconds. This is the shortest interval between CurrentTimeUpdated being emitted, the actual time between updates may be greater depending on the underlying player's current time update interval.

See also
GetMinimumTimeUpdateIntervalMs
CurrentTimeUpdated

◆ SetPlatformPlayerContainerViewHandle()

void CYIAbstractVideoPlayer::SetPlatformPlayerContainerViewHandle ( std::shared_ptr< CYIPlatformViewHandle pPlatformPlayerContainerViewHandle)
protected

Updates the platform player container view handle and emits the CYIAbstractVideoPlayer::PlatformPlayerContainerViewHandleChanged signal.

Note
It is intended that the concrete player implementation is to call this when the native player view container is created in order for the signal to be emitted and the getter to work, if there is a valid native player view container which can be exposed.

◆ SetPlatformPlayerHandle()

void CYIAbstractVideoPlayer::SetPlatformPlayerHandle ( std::shared_ptr< CYIPlatformPlayerHandle pPlatformPlayerHandle)
protected

Updates the platform player handle and emits the CYIAbstractVideoPlayer::PlatformPlayerHandleChanged signal.

Note
It is intended that the concrete player implementation is to call this when the native player implementation is created in order for the signal to be emitted and the getter to work, if there is a valid native player implementation which can be exposed.

◆ 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 PlayStation, 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.

◆ 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

◆ 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

◆ 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

Member Data Documentation

◆ AudioBitrateChanged

CYISignal<float> CYIAbstractVideoPlayer::AudioBitrateChanged

Signals that the audio bitrate measured in kilobits per second 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_initialBandwidthHint

uint64_t CYIAbstractVideoPlayer::m_initialBandwidthHint
protected

The initial bandwidth hint, used by player implementations to select an initial playback variant with a suitable bitrate.

◆ 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_pStyleManager

std::unique_ptr<CYIClosedCaptionsStyleManager> CYIAbstractVideoPlayer::m_pStyleManager
protected

The closed captions style manager of this player. This is used to set a custom style to captions of the player.

Note
When a caption style is requested from the manager, it will first request a custom style, then the CYIClosedCaptionsStylingBridge style and finally the default style in order of what is available.
See also
GetClosedCaptionsStyleManager

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

◆ PlatformPlayerContainerViewHandleChanged

CYISignal<std::shared_ptr<CYIPlatformViewHandle> , std::shared_ptr<CYIPlatformViewHandle> > CYIAbstractVideoPlayer::PlatformPlayerContainerViewHandleChanged

Platform player container view handle changed notification. Once the native platform player's container view has been created, changed or destroyed, this signal will be emitted along with the previous and new handles, if available on the current platform. Any retained version of the previous view handle should be discarded and no longer used.

See also
GetPlatformPlayerContainerViewHandle

◆ PlatformPlayerHandleChanged

CYISignal<std::shared_ptr<CYIPlatformPlayerHandle> , std::shared_ptr<CYIPlatformPlayerHandle> > CYIAbstractVideoPlayer::PlatformPlayerHandleChanged

Platform player handle changed notification. Once the native platform player has been created, changed or destroyed, this signal will be emitted along with the previous and new handles, if available on the current platform. Any retained version of the previous player handle should be discarded and no longer used.

See also
GetPlatformPlayerHandle

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

◆ TotalBitrateChanged

CYISignal<float> CYIAbstractVideoPlayer::TotalBitrateChanged

Signals that the combined video and audio bitrate measured in kilobits per second has changed. This may be emitted at any point.

◆ VideoBitrateChanged

CYISignal<float> CYIAbstractVideoPlayer::VideoBitrateChanged

Signals that the video bitrate measured in kilobits per second has changed. This may be emitted at any point.


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