Shaka Player Embedded
|
#include <av_media_player.h>
Classes | |
class | Impl |
Public Member Functions | |
AvMediaPlayer (ClientList *clients) | |
~AvMediaPlayer () override | |
const void * | GetIosView () |
const void * | GetAvPlayer () |
MediaCapabilitiesInfo | DecodingInfo (const MediaDecodingConfiguration &config) const override |
struct VideoPlaybackQuality | VideoPlaybackQuality () const override |
void | AddClient (Client *client) const override |
void | RemoveClient (Client *client) const override |
std::vector< BufferedRange > | GetBuffered () const override |
VideoReadyState | ReadyState () const override |
VideoPlaybackState | PlaybackState () const override |
std::vector< std::shared_ptr< MediaTrack > > | AudioTracks () override |
std::vector< std::shared_ptr< const MediaTrack > > | AudioTracks () const override |
std::vector< std::shared_ptr< MediaTrack > > | VideoTracks () override |
std::vector< std::shared_ptr< const MediaTrack > > | VideoTracks () const override |
std::vector< std::shared_ptr< TextTrack > > | TextTracks () override |
std::vector< std::shared_ptr< const TextTrack > > | TextTracks () const override |
std::shared_ptr< TextTrack > | AddTextTrack (TextTrackKind kind, const std::string &label, const std::string &language) override |
bool | SetVideoFillMode (VideoFillMode mode) override |
uint32_t | Width () const override |
uint32_t | Height () const override |
double | Volume () const override |
void | SetVolume (double volume) override |
bool | Muted () const override |
void | SetMuted (bool muted) override |
void | Play () override |
void | Pause () override |
double | CurrentTime () const override |
void | SetCurrentTime (double time) override |
double | Duration () const override |
void | SetDuration (double duration) override |
double | PlaybackRate () const override |
void | SetPlaybackRate (double rate) override |
bool | AttachSource (const std::string &src) override |
bool | AttachMse () override |
bool | AddMseBuffer (const std::string &mime, bool is_video, const ElementaryStream *stream) override |
void | LoadedMetaData (double duration) override |
void | MseEndOfStream () override |
bool | SetEmeImplementation (const std::string &key_system, eme::Implementation *implementation) override |
void | Detach () override |
![]() | |
MediaPlayer () | |
virtual | ~ MediaPlayer () |
MediaPlayer (const MediaPlayer &)=delete | |
MediaPlayer & | operator= (const MediaPlayer &)=delete |
MediaPlayer (MediaPlayer &&)=delete | |
MediaPlayer & | operator= (MediaPlayer &&)=delete |
Additional Inherited Members | |
![]() | |
static void | SetMediaPlayerForSupportChecks (const MediaPlayer *player) |
static const MediaPlayer * | GetMediaPlayerForSupportChecks () |
A MediaPlayer implementation that uses iOS' AVPlayer to play src= content.
Definition at line 32 of file av_media_player.h.
|
explicit |
Definition at line 406 of file av_media_player.mm.
|
override |
Definition at line 407 of file av_media_player.mm.
|
overridevirtual |
Adds a new client listener. The given object will be called when events are raised. Clients are called in the order they are registered. Calling this with an already-registered client will have no effect.
Implements shaka::media::MediaPlayer.
Definition at line 435 of file av_media_player.mm.
|
overridevirtual |
Adds a new MSE buffer to pull frames from. This can be called after normal playback has started, but that doesn't have to be supported. This will be called for each SourceBuffer object created. If the source content is multiplexed, this will be called twice for the same input stream, but will be given separate audio/video buffers.
mime | The full MIME type given from JavaScript. |
is_video | True if this is for a video stream, false for audio. |
stream | The stream containing the encoded frames. |
Implements shaka::media::MediaPlayer.
Definition at line 579 of file av_media_player.mm.
|
overridevirtual |
Adds a new text track to the player. This can return nullptr if this isn't supported.
kind | The kind of the new track. |
label | A string label for the track. |
language | The language of the new track. |
Implements shaka::media::MediaPlayer.
Definition at line 484 of file av_media_player.mm.
|
overridevirtual |
Starts MSE-based playback. At a later time, AddMseBuffer will be called to give streams to pull from.
Implements shaka::media::MediaPlayer.
Definition at line 576 of file av_media_player.mm.
|
overridevirtual |
Starts playback using the given src= URL. The player should read data from the given URL and play its content.
src | The URL to read from. |
Implements shaka::media::MediaPlayer.
Definition at line 573 of file av_media_player.mm.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 463 of file av_media_player.mm.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 466 of file av_media_player.mm.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 538 of file av_media_player.mm.
|
overridevirtual |
Checks whether the given content can be played. In general, for MSE playback, this shouldn't check whether it can be demuxed, this should only check whether the streams can be decoded. The Demuxer should handle whether it can be demuxed.
The return value must be the same throughout playback and should be the same for all MediaPlayer implementations that are used. Since type support checking is done before a specific MediaPlayer is selected, it is expected that all MediaPlayer instances return the same value. If this isn't the case, it can cause runtime decoder errors since filtering is done early.
config | The configuration to check support for. |
Implements shaka::media::MediaPlayer.
Definition at line 416 of file av_media_player.mm.
|
overridevirtual |
Stops playback from the current media. This should stop using the current ElementaryStream objects and halt playback.
Implements shaka::media::MediaPlayer.
Definition at line 589 of file av_media_player.mm.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 550 of file av_media_player.mm.
const void * shaka::media::ios::AvMediaPlayer::GetAvPlayer | ( | ) |
Definition at line 412 of file av_media_player.mm.
|
overridevirtual |
Gets the ranges of buffered content in the media. For MSE playback, this should use the ElementaryStream objects passed to this object; for src= playback, this type will internally handle buffering.
Implements shaka::media::MediaPlayer.
Definition at line 442 of file av_media_player.mm.
const void * shaka::media::ios::AvMediaPlayer::GetIosView | ( | ) |
Definition at line 409 of file av_media_player.mm.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 500 of file av_media_player.mm.
|
overridevirtual |
For MSE playback, this indicates that the init segments for the input streams have been received and have the given estimated duration. If there is more than one input stream, this is called once they all have been loaded.
duration | The estimated duration of the stream based on the init segments; can be infinity if unknown. |
Implements shaka::media::MediaPlayer.
Definition at line 583 of file av_media_player.mm.
|
overridevirtual |
For MSE playback, this indicates that the last segment has been handled and the current buffered end represents the end of all the content.
Implements shaka::media::MediaPlayer.
Definition at line 584 of file av_media_player.mm.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 519 of file av_media_player.mm.
|
overridevirtual |
Pauses playback of the current content. If this is called before AttachSource/AttachMse, this should not start playing when content is given.
Implements shaka::media::MediaPlayer.
Definition at line 535 of file av_media_player.mm.
|
overridevirtual |
Starts playback of the current content. If this is called before AttachSource/AttachMse, this should start playing when content is given.
Implements shaka::media::MediaPlayer.
Definition at line 532 of file av_media_player.mm.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 560 of file av_media_player.mm.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 460 of file av_media_player.mm.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 457 of file av_media_player.mm.
|
overridevirtual |
Removes a client listener. The given client will no longer be called when events happen.
Implements shaka::media::MediaPlayer.
Definition at line 438 of file av_media_player.mm.
|
overridevirtual |
Seeks to a new position in the currently-playing stream. Does nothing if no content is loaded.
time | The presentation time to seek to. |
Implements shaka::media::MediaPlayer.
Definition at line 545 of file av_media_player.mm.
|
overridevirtual |
Sets the duration of the media.
duration | The duration, in seconds, to set to. |
Implements shaka::media::MediaPlayer.
Definition at line 557 of file av_media_player.mm.
|
overridevirtual |
Sets the EME implementation instance used to decrypt media. This will be set early in playback and won't be changed while playing. This will be called with nullptr to clear the EME implementation.
key_system | The name of the key system this is for. |
implementation | The implementation used to decrypt frames. |
Implements shaka::media::MediaPlayer.
Definition at line 585 of file av_media_player.mm.
|
overridevirtual |
Sets whether the audio is muted.
Implements shaka::media::MediaPlayer.
Definition at line 526 of file av_media_player.mm.
|
overridevirtual |
Sets the playback rate of the video. Does nothing if no content is loaded.
rate | The new playback rate. |
Implements shaka::media::MediaPlayer.
Definition at line 567 of file av_media_player.mm.
|
overridevirtual |
Sets how to resize video frames within the drawing region.
mode | The new method to resize the video frames. |
Implements shaka::media::MediaPlayer.
Definition at line 490 of file av_media_player.mm.
|
overridevirtual |
Sets the volume [0, 1] to render audio at.
Implements shaka::media::MediaPlayer.
Definition at line 514 of file av_media_player.mm.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 477 of file av_media_player.mm.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 480 of file av_media_player.mm.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 432 of file av_media_player.mm.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 470 of file av_media_player.mm.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 473 of file av_media_player.mm.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 507 of file av_media_player.mm.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 493 of file av_media_player.mm.