You.i Engine
CYIAVPlayer Class Reference

Detailed Description

Implementation of abstract video player for iOS, tvOs and OSX.

Apps must include AVFoundation.framework and CoreMedia.framework

#include <player/YiAVPlayer.h>

Inheritance diagram for CYIAVPlayer:

Public Member Functions

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

Friends

class CYIAVPlayerPriv
 

Additional Inherited Members

- Public Types inherited from CYIAbstractVideoPlayer
enum  MediaState {
  MediaState::Unloaded,
  MediaState::Preparing,
  MediaState::Ready
}
 
enum  PlaybackState {
  PlaybackState::Playing,
  PlaybackState::Paused,
  PlaybackState::Buffering
}
 
enum  StreamingFormat {
  StreamingFormat::HLS = 0,
  StreamingFormat::Smooth,
  StreamingFormat::DASH,
  StreamingFormat::MP4
}
 
enum  DRMScheme {
  DRMScheme::None = 0,
  DRMScheme::FairPlay,
  DRMScheme::PlayReady,
  DRMScheme::WidevineModular,
  DRMScheme::WidevineModularCustomRequest
}
 
enum  ErrorCode {
  ErrorCode::PlaybackError,
  ErrorCode::UnsupportedFormat,
  ErrorCode::StateTransitionError,
  ErrorCode::DRMError,
  ErrorCode::InitializationError,
  ErrorCode::Unknown
}
 
using RTTIInstantiatability = CYIRuntimeTypeInfo::NonInstantiableTag
 
using RefreshDRMConfigurationCallback = std::function< std::unique_ptr< CYIAbstractVideoPlayer::DRMConfiguration >(std::unique_ptr< CYIAbstractVideoPlayer::DRMConfiguration >)>
 
- Public Attributes 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< 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 inherited from CYIAbstractVideoPlayer
 CYIAbstractVideoPlayer ()
 
const std::shared_ptr< CYIMaterial > & GetVideoMaterial () const
 
void SetVideoSurfaceSize (const glm::ivec2 &size)
 
void ChangeInitialPlaybackState (CYIAbstractVideoPlayer::PlaybackState initialState)
 
CYIAbstractVideoPlayer::PlaybackState GetRequestedInitialPlaybackState () const
 
void CheckAndNotifyMediaTracksChanged ()
 
void UpdateCurrentTime ()
 
void OnRefreshDRMConfiguration ()
 
virtual void Init_ ()
 
virtual bool HasInitialBandwidthHintHandling_ () const
 
virtual void GetClosedCaptionsDispatcher_ () const
 
virtual void SetUserAgent_ (const CYIString &userAgent)
 
virtual BackgroundPlaybackInterfaceGetBackgroundPlaybackInterface_ () const
 
virtual HeadphoneJackInterfaceGetHeadphoneJackInterface_ () const
 
virtual BufferingInterfaceGetBufferingInterface_ () const
 
virtual VideoRequestHTTPHeadersInterfaceGetVideoRequestHTTPHeadersInterface_ ()
 
virtual MediaPlaybackControlsInterfaceGetMediaPlaybackControlsInterface_ () const
 
- Protected Attributes inherited from CYIAbstractVideoPlayer
CYISignal< ErrorNotifyErrorOccurred
 
CYISignal NotifyPlaybackComplete
 
CYISignal< uint64_t > NotifyDurationChanged
 
CYISignal< bool, uint64_t > NotifySeekCompleted
 
std::unique_ptr< CYIVideoPlayerStateManagerm_pStateManager
 
std::unique_ptr< CYIClosedCaptionsDispatcherm_pClosedCaptionsDispatcher
 
std::unique_ptr< DRMConfigurationm_pDRMConfiguration
 
uint64_t m_maxBitrate
 
uint64_t m_initialBandwidthHint
 
uint64_t m_initialStartTimeMs
 
RefreshDRMConfigurationCallback m_refreshDRMConfigurationCallback
 

Constructor & Destructor Documentation

◆ CYIAVPlayer()

CYIAVPlayer::CYIAVPlayer ( )

◆ ~CYIAVPlayer()

virtual CYIAVPlayer::~CYIAVPlayer ( )
virtual

Member Function Documentation

◆ EnableAutoExternalPlaybackWhenAvailable()

void CYIAVPlayer::EnableAutoExternalPlaybackWhenAvailable ( bool  enabled)

When enabled and an external display is active, playback will automatically switch to the external display.

Note
Enabling this setting on multiple players in the same screen will give inconsistent results.
This feature has no effect on OSX.
This feature is disabled by default.

◆ GetClosedCaptionsTracksFromMediaSelectionGroup()

const std::vector<CYIAbstractVideoPlayer::ClosedCaptionsTrackInfo> CYIAVPlayer::GetClosedCaptionsTracksFromMediaSelectionGroup ( ) const

Returns the closed captions and subtitle information present in the asset's media selection group, which corresponds to the information in the asset manifest.

See also
GetClosedCaptionsTracksFromTrackList

◆ GetClosedCaptionsTracksFromTrackList()

const std::vector<CYIAbstractVideoPlayer::ClosedCaptionsTrackInfo> CYIAVPlayer::GetClosedCaptionsTracksFromTrackList ( ) const

Returns the closed captions information present in the video tracks, which corresponds to in-stream CEA 608/708 data.

Note
GetClosedCaptionsTracksFromMediaSelectionGroup may detect some or all of these tracks as well if, for example, an HLS manifest contains #EXT-X-MEDIA:TYPE=CLOSED-CAPTIONS tags that correspond to the in-stream captions track.
See also
GetClosedCaptionsTracksFromMediaSelectionGroup

Friends And Related Function Documentation

◆ CYIAVPlayerPriv

friend class CYIAVPlayerPriv
friend

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