Shaka Player Embedded
|
#include <js_manager.h>
Classes | |
struct | StartupOptions |
Public Member Functions | |
JsManager () | |
JsManager (const StartupOptions &options) | |
JsManager (JsManager &&) | |
~JsManager () | |
JsManager & | operator= (JsManager &&) |
JsManager (const JsManager &)=delete | |
JsManager & | operator= (const JsManager &)=delete |
void | Stop () |
void | WaitUntilFinished () |
AsyncResults< void > | RunScript (const std::string &path) |
AsyncResults< void > | RegisterNetworkScheme (const std::string &scheme, SchemePlugin *plugin) |
AsyncResults< void > | UnregisterNetworkScheme (const std::string &scheme) |
Manages the JavaScript engine. There must be exactly one instance per program. This manages a single JavaScript instance, but can support any number of Player or Video instances.
Definition at line 53 of file js_manager.h.
shaka::JsManager::JsManager | ( | ) |
Definition at line 50 of file js_manager.cc.
shaka::JsManager::JsManager | ( | const StartupOptions & | options | ) |
Definition at line 51 of file js_manager.cc.
|
default |
shaka::JsManager::~JsManager | ( | ) |
Definition at line 53 of file js_manager.cc.
|
delete |
AsyncResults< void > shaka::JsManager::RegisterNetworkScheme | ( | const std::string & | scheme, |
SchemePlugin * | plugin | ||
) |
Registers a network scheme plugin that handles network requests. This is global and applies to all requests for this scheme.
scheme | The scheme this handles (e.g. 'http'). |
plugin | The plugin object that handles the requests. |
Definition at line 85 of file js_manager.cc.
AsyncResults< void > shaka::JsManager::RunScript | ( | const std::string & | path | ) |
Executes the given script in JavaScript. This can be used to register plugins or to run tests. The script will be scheduled to run on the event loop.
Definition at line 67 of file js_manager.cc.
void shaka::JsManager::Stop | ( | ) |
Stops the JavaScript engine and all background threads. It is invalid to call any methods on this class after this returns.
Definition at line 59 of file js_manager.cc.
AsyncResults< void > shaka::JsManager::UnregisterNetworkScheme | ( | const std::string & | scheme | ) |
Removes an existing network scheme plugin.
scheme | The scheme to remove (e.g. 'http'). |
Definition at line 110 of file js_manager.cc.
void shaka::JsManager::WaitUntilFinished | ( | ) |
Blocks the current thread until all scheduled work is finished. This is used by the tests to detect when they are done. This should not be called if there are live Player instances as they use setInterval
, which means there will always be pending work.
Definition at line 63 of file js_manager.cc.