Shaka Player Embedded
|
#include <player.h>
Classes | |
class | Client |
class | Impl |
Public Types | |
enum | LogLevel : uint8_t { LogLevel::None = 0, LogLevel::Error = 1, LogLevel::Warning = 2, LogLevel::Info = 3, LogLevel::Debug = 4, LogLevel::V1 = 5, LogLevel::V2 = 6 } |
Public Member Functions | |
Player (JsManager *engine) | |
Player (Player &&) | |
~Player () | |
Player & | operator= (Player &&) |
Player (const Player &)=delete | |
Player & | operator= (const Player &)=delete |
AsyncResults< void > | Initialize (Client *client, media::MediaPlayer *player=nullptr) |
AsyncResults< void > | Destroy () |
AsyncResults< bool > | IsAudioOnly () const |
AsyncResults< bool > | IsBuffering () const |
AsyncResults< bool > | IsInProgress () const |
AsyncResults< bool > | IsLive () const |
AsyncResults< bool > | IsTextTrackVisible () const |
AsyncResults< bool > | UsingEmbeddedTextTrack () const |
AsyncResults< optional< std::string > > | AssetUri () const |
AsyncResults< optional< DrmInfo > > | DrmInfo () const |
AsyncResults< std::vector< LanguageRole > > | GetAudioLanguagesAndRoles () const |
AsyncResults< BufferedInfo > | GetBufferedInfo () const |
AsyncResults< double > | GetExpiration () const |
AsyncResults< Stats > | GetStats () const |
AsyncResults< std::vector< Track > > | GetTextTracks () const |
AsyncResults< std::vector< Track > > | GetVariantTracks () const |
AsyncResults< std::vector< LanguageRole > > | GetTextLanguagesAndRoles () const |
AsyncResults< std::string > | KeySystem () const |
AsyncResults< BufferedRange > | SeekRange () const |
AsyncResults< void > | Load (const std::string &manifest_uri, double start_time=NAN, const std::string &mime_type="") |
AsyncResults< void > | Unload () |
AsyncResults< void > | ResetConfiguration () |
AsyncResults< void > | RetryStreaming () |
AsyncResults< void > | SelectAudioLanguage (const std::string &language, optional< std::string > role=nullopt) |
AsyncResults< void > | SelectEmbeddedTextTrack () |
AsyncResults< void > | SelectTextLanguage (const std::string &language, optional< std::string > role=nullopt) |
AsyncResults< void > | SelectTextTrack (const Track &track) |
AsyncResults< void > | SelectVariantTrack (const Track &track, bool clear_buffer=false) |
AsyncResults< void > | SetTextTrackVisibility (bool visibility) |
AsyncResults< Track > | AddTextTrack (const std::string &uri, const std::string &language, const std::string &kind, const std::string &mime, const std::string &codec="", const std::string &label="") |
AsyncResults< void > | Attach (media::MediaPlayer *player) |
AsyncResults< void > | Detach () |
void | AddNetworkFilters (NetworkFilters *filters) |
void | RemoveNetworkFilters (NetworkFilters *filters) |
AsyncResults< bool > | Configure (const std::string &name_path, DefaultValueType) |
AsyncResults< bool > | Configure (const std::string &name_path, bool value) |
AsyncResults< bool > | Configure (const std::string &name_path, double value) |
AsyncResults< bool > | Configure (const std::string &name_path, const std::string &value) |
template<typename T , typename = typename std::enable_if< std::is_arithmetic<T>::value>::type> | |
AsyncResults< bool > | Configure (const std::string &name_path, T value) |
AsyncResults< bool > | Configure (const std::string &name_path, const char *value) |
AsyncResults< bool > | GetConfigurationBool (const std::string &name_path) |
AsyncResults< double > | GetConfigurationDouble (const std::string &name_path) |
AsyncResults< std::string > | GetConfigurationString (const std::string &name_path) |
AsyncResults< bool > | Configure (const std::string &name_path, const std::vector< uint8_t > &data) |
AsyncResults< bool > | Configure (const std::string &name_path, const uint8_t *data, size_t data_size) |
Static Public Member Functions | |
static AsyncResults< void > | SetLogLevel (JsManager *engine, LogLevel level) |
static AsyncResults< LogLevel > | GetLogLevel (JsManager *engine) |
static AsyncResults< std::string > | GetPlayerVersion (JsManager *engine) |
Friends | |
class | Storage |
Represents a JavaScript shaka.Player instance. This handles loading manifests and changing tracks.
|
strong |
shaka::Player::Player | ( | JsManager * | engine | ) |
|
default |
|
delete |
void shaka::Player::AddNetworkFilters | ( | NetworkFilters * | filters | ) |
AsyncResults< Track > shaka::Player::AddTextTrack | ( | const std::string & | uri, |
const std::string & | language, | ||
const std::string & | kind, | ||
const std::string & | mime, | ||
const std::string & | codec = "" , |
||
const std::string & | label = "" |
||
) |
AsyncResults< optional< std::string > > shaka::Player::AssetUri | ( | ) | const |
AsyncResults< void > shaka::Player::Attach | ( | media::MediaPlayer * | player | ) |
AsyncResults< bool > shaka::Player::Configure | ( | const std::string & | name_path, |
DefaultValueType | |||
) |
Sets a configuration value on the Player instance. This is simply forwarded to the JavaScript instance. No error is returned if the requested configuration isn't present or is an invalid type, see the logs for errors. The path is a '.' separated list of names to reach the configuration. For example:
'abr.enabled' => {abr: {enabled: value}}
AsyncResults< bool > shaka::Player::Configure | ( | const std::string & | name_path, |
bool | value | ||
) |
Sets a configuration value on the Player instance. This is simply forwarded to the JavaScript instance. No error is returned if the requested configuration isn't present or is an invalid type, see the logs for errors. The path is a '.' separated list of names to reach the configuration. For example:
'abr.enabled' => {abr: {enabled: value}}
AsyncResults< bool > shaka::Player::Configure | ( | const std::string & | name_path, |
double | value | ||
) |
Sets a configuration value on the Player instance. This is simply forwarded to the JavaScript instance. No error is returned if the requested configuration isn't present or is an invalid type, see the logs for errors. The path is a '.' separated list of names to reach the configuration. For example:
'abr.enabled' => {abr: {enabled: value}}
AsyncResults< bool > shaka::Player::Configure | ( | const std::string & | name_path, |
const std::string & | value | ||
) |
Sets a configuration value on the Player instance. This is simply forwarded to the JavaScript instance. No error is returned if the requested configuration isn't present or is an invalid type, see the logs for errors. The path is a '.' separated list of names to reach the configuration. For example:
'abr.enabled' => {abr: {enabled: value}}
|
inline |
Sets a configuration value on the Player instance. This is simply forwarded to the JavaScript instance. No error is returned if the requested configuration isn't present or is an invalid type, see the logs for errors. The path is a '.' separated list of names to reach the configuration. For example:
'abr.enabled' => {abr: {enabled: value}}
|
inline |
Sets a configuration value on the Player instance. This is simply forwarded to the JavaScript instance. No error is returned if the requested configuration isn't present or is an invalid type, see the logs for errors. The path is a '.' separated list of names to reach the configuration. For example:
'abr.enabled' => {abr: {enabled: value}}
|
inline |
AsyncResults< bool > shaka::Player::Configure | ( | const std::string & | name_path, |
const uint8_t * | data, | ||
size_t | data_size | ||
) |
AsyncResults< void > shaka::Player::Destroy | ( | ) |
AsyncResults< void > shaka::Player::Detach | ( | ) |
AsyncResults< optional< DrmInfo > > shaka::Player::DrmInfo | ( | ) | const |
AsyncResults< std::vector< LanguageRole > > shaka::Player::GetAudioLanguagesAndRoles | ( | ) | const |
AsyncResults< BufferedInfo > shaka::Player::GetBufferedInfo | ( | ) | const |
AsyncResults< bool > shaka::Player::GetConfigurationBool | ( | const std::string & | name_path | ) |
Gets a configuration value from the Player instance. This is simply forwarded to the JavaScript instance. No error is returned if the requested configuration isn't present or is an invalid type, see the logs for errors. The path is a '.' separated list of names to reach the configuration. For example:
'abr.enabled' => {abr: {enabled: value}}
TODO: These will be replaced with a more general GetConfiguration() method in the future.
AsyncResults< double > shaka::Player::GetConfigurationDouble | ( | const std::string & | name_path | ) |
Gets a configuration value from the Player instance. This is simply forwarded to the JavaScript instance. No error is returned if the requested configuration isn't present or is an invalid type, see the logs for errors. The path is a '.' separated list of names to reach the configuration. For example:
'abr.enabled' => {abr: {enabled: value}}
TODO: These will be replaced with a more general GetConfiguration() method in the future.
AsyncResults< std::string > shaka::Player::GetConfigurationString | ( | const std::string & | name_path | ) |
Gets a configuration value from the Player instance. This is simply forwarded to the JavaScript instance. No error is returned if the requested configuration isn't present or is an invalid type, see the logs for errors. The path is a '.' separated list of names to reach the configuration. For example:
'abr.enabled' => {abr: {enabled: value}}
TODO: These will be replaced with a more general GetConfiguration() method in the future.
AsyncResults< double > shaka::Player::GetExpiration | ( | ) | const |
|
static |
|
static |
AsyncResults< Stats > shaka::Player::GetStats | ( | ) | const |
AsyncResults< std::vector< LanguageRole > > shaka::Player::GetTextLanguagesAndRoles | ( | ) | const |
AsyncResults< std::vector< Track > > shaka::Player::GetTextTracks | ( | ) | const |
AsyncResults< std::vector< Track > > shaka::Player::GetVariantTracks | ( | ) | const |
AsyncResults< void > shaka::Player::Initialize | ( | Client * | client, |
media::MediaPlayer * | player = nullptr |
||
) |
Initializes the Player instance. This must be called once before any other method.
This can be given a MediaPlayer to attach to immediately. If not given, you need to call Attach before loading content.
client | The client that handles asynchronous events. |
player | The MediaPlayer that controls playback. |
AsyncResults< bool > shaka::Player::IsAudioOnly | ( | ) | const |
AsyncResults< bool > shaka::Player::IsBuffering | ( | ) | const |
AsyncResults< bool > shaka::Player::IsInProgress | ( | ) | const |
AsyncResults< bool > shaka::Player::IsLive | ( | ) | const |
AsyncResults< bool > shaka::Player::IsTextTrackVisible | ( | ) | const |
AsyncResults< std::string > shaka::Player::KeySystem | ( | ) | const |
AsyncResults< void > shaka::Player::Load | ( | const std::string & | manifest_uri, |
double | start_time = NAN , |
||
const std::string & | mime_type = "" |
||
) |
Loads the given manifest. Returns a future that will resolve when the load is complete.
manifest_uri | The URI of the manifest to load. |
start_time | The time to start playing at, in seconds. |
mime_type | The MIME type of the content being loaded. If the MIME type can't be detected based on the extension, we'll make a HEAD request to the URL to figure it out. |
void shaka::Player::RemoveNetworkFilters | ( | NetworkFilters * | filters | ) |
AsyncResults< void > shaka::Player::ResetConfiguration | ( | ) |
AsyncResults< void > shaka::Player::RetryStreaming | ( | ) |
AsyncResults< BufferedRange > shaka::Player::SeekRange | ( | ) | const |
AsyncResults< void > shaka::Player::SelectAudioLanguage | ( | const std::string & | language, |
optional< std::string > | role = nullopt |
||
) |
AsyncResults< void > shaka::Player::SelectEmbeddedTextTrack | ( | ) |
AsyncResults< void > shaka::Player::SelectTextLanguage | ( | const std::string & | language, |
optional< std::string > | role = nullopt |
||
) |
AsyncResults< void > shaka::Player::SelectTextTrack | ( | const Track & | track | ) |
AsyncResults< void > shaka::Player::SelectVariantTrack | ( | const Track & | track, |
bool | clear_buffer = false |
||
) |
|
static |
AsyncResults< void > shaka::Player::SetTextTrackVisibility | ( | bool | visibility | ) |
AsyncResults< void > shaka::Player::Unload | ( | ) |
AsyncResults< bool > shaka::Player::UsingEmbeddedTextTrack | ( | ) | const |