Shaka Player Embedded
|
#include <mse_media_player.h>
Public Member Functions | |
MseMediaPlayer (ClientList *clients, VideoRenderer *video_renderer, AudioRenderer *audio_renderer) | |
~MseMediaPlayer () override | |
void | SetDecoders (Decoder *video_decoder, Decoder *audio_decoder) |
MediaCapabilitiesInfo | DecodingInfo (const MediaDecodingConfiguration &config) const override |
struct VideoPlaybackQuality | VideoPlaybackQuality () const override |
void | AddClient (MediaPlayer::Client *client) const override |
void | RemoveClient (MediaPlayer::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 | Height () const override |
uint32_t | Width () 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 () |
Defines the default MediaSource-based MediaPlayer. This can only handle MSE playback and uses custom playback tracking.
Definition at line 38 of file mse_media_player.h.
shaka::media::MseMediaPlayer::MseMediaPlayer | ( | ClientList * | clients, |
VideoRenderer * | video_renderer, | ||
AudioRenderer * | audio_renderer | ||
) |
Definition at line 29 of file mse_media_player.cc.
|
override |
Definition at line 86 of file mse_media_player.cc.
|
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 135 of file mse_media_player.cc.
|
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 290 of file mse_media_player.cc.
|
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 195 of file mse_media_player.cc.
|
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 277 of file mse_media_player.cc.
|
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 273 of file mse_media_player.cc.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 162 of file mse_media_player.cc.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 167 of file mse_media_player.cc.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 246 of file mse_media_player.cc.
|
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 98 of file mse_media_player.cc.
|
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 339 of file mse_media_player.cc.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 254 of file mse_media_player.cc.
|
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 143 of file mse_media_player.cc.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 206 of file mse_media_player.cc.
|
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 308 of file mse_media_player.cc.
|
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 314 of file mse_media_player.cc.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 230 of file mse_media_player.cc.
|
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 242 of file mse_media_player.cc.
|
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 238 of file mse_media_player.cc.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 262 of file mse_media_player.cc.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 158 of file mse_media_player.cc.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 153 of file mse_media_player.cc.
|
overridevirtual |
Removes a client listener. The given client will no longer be called when events happen.
Implements shaka::media::MediaPlayer.
Definition at line 139 of file mse_media_player.cc.
|
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 250 of file mse_media_player.cc.
Definition at line 91 of file mse_media_player.cc.
|
overridevirtual |
Sets the duration of the media.
duration | The duration, in seconds, to set to. |
Implements shaka::media::MediaPlayer.
Definition at line 258 of file mse_media_player.cc.
|
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 331 of file mse_media_player.cc.
|
overridevirtual |
Sets whether the audio is muted.
Implements shaka::media::MediaPlayer.
Definition at line 234 of file mse_media_player.cc.
|
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 266 of file mse_media_player.cc.
|
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 202 of file mse_media_player.cc.
|
overridevirtual |
Sets the volume [0, 1] to render audio at.
Implements shaka::media::MediaPlayer.
Definition at line 226 of file mse_media_player.cc.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 184 of file mse_media_player.cc.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 189 of file mse_media_player.cc.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 131 of file mse_media_player.cc.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 173 of file mse_media_player.cc.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 178 of file mse_media_player.cc.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 222 of file mse_media_player.cc.
|
overridevirtual |
Implements shaka::media::MediaPlayer.
Definition at line 214 of file mse_media_player.cc.