Shaka Player Embedded
Classes | Public Member Functions | List of all members
shaka::JsManager Class Referencefinal

#include <js_manager.h>

Classes

struct  StartupOptions
 

Public Member Functions

 JsManager ()
 
 JsManager (const StartupOptions &options)
 
 JsManager (JsManager &&)
 
 ~JsManager ()
 
JsManageroperator= (JsManager &&)
 
 JsManager (const JsManager &)=delete
 
JsManageroperator= (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)
 

Detailed Description

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.

Constructor & Destructor Documentation

§ JsManager() [1/4]

shaka::JsManager::JsManager ( )

Definition at line 50 of file js_manager.cc.

§ JsManager() [2/4]

shaka::JsManager::JsManager ( const StartupOptions options)

Definition at line 51 of file js_manager.cc.

§ JsManager() [3/4]

shaka::JsManager::JsManager ( JsManager &&  )
default

§ ~JsManager()

shaka::JsManager::~JsManager ( )

Definition at line 53 of file js_manager.cc.

§ JsManager() [4/4]

shaka::JsManager::JsManager ( const JsManager )
delete

Member Function Documentation

§ operator=() [1/2]

JsManager & shaka::JsManager::operator= ( JsManager &&  )
default

§ operator=() [2/2]

JsManager& shaka::JsManager::operator= ( const JsManager )
delete

§ RegisterNetworkScheme()

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.

Parameters
schemeThe scheme this handles (e.g. 'http').
pluginThe plugin object that handles the requests.

Definition at line 85 of file js_manager.cc.

§ RunScript()

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.

§ Stop()

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.

§ UnregisterNetworkScheme()

AsyncResults< void > shaka::JsManager::UnregisterNetworkScheme ( const std::string &  scheme)

Removes an existing network scheme plugin.

Parameters
schemeThe scheme to remove (e.g. 'http').

Definition at line 110 of file js_manager.cc.

§ WaitUntilFinished()

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.


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