Shaka Player Embedded
Classes | Public Member Functions | List of all members
shaka::SchemePlugin Class Referenceabstract

#include <net.h>

Classes

class  Client
 

Public Member Functions

 SchemePlugin ()
 
virtual ~ SchemePlugin ()
 
 SchemePlugin (const SchemePlugin &)=delete
 
SchemePluginoperator= (const SchemePlugin &)=delete
 
 SchemePlugin (SchemePlugin &&)=delete
 
SchemePluginoperator= (SchemePlugin &&)=delete
 
virtual std::future< optional< Error > > OnNetworkRequest (const std::string &uri, RequestType type, const Request &request, Client *client, Response *response)=0
 

Detailed Description

Defines an interface for network scheme plugins. These are used by Shaka Player to make network requests. Requests can be completed asynchronously by returning a std::future instance. This may be called while an asynchronous request is still completing, but won't be called concurrently. This is called on the JS main thread, so it is preferable to avoid lots of work and do it asynchronously.

Definition at line 174 of file net.h.

Constructor & Destructor Documentation

§ SchemePlugin() [1/3]

shaka::SchemePlugin::SchemePlugin ( )

§ ~ SchemePlugin()

virtual shaka::SchemePlugin::~ SchemePlugin ( )
virtual

§ SchemePlugin() [2/3]

shaka::SchemePlugin::SchemePlugin ( const SchemePlugin )
delete

§ SchemePlugin() [3/3]

shaka::SchemePlugin::SchemePlugin ( SchemePlugin &&  )
delete

Member Function Documentation

§ OnNetworkRequest()

virtual std::future<optional<Error> > shaka::SchemePlugin::OnNetworkRequest ( const std::string &  uri,
RequestType  type,
const Request request,
Client client,
Response response 
)
pure virtual

Called when the player wants to make a network request. This is expected to read the Request object and load the data into the response object. The objects will remain valid until the returned future resolves.

Parameters
uriThe current URI of the request.
typeThe type of request.
requestThe request info.
clientA client object used to send events to.
responseThe object to fill with response data.
Returns
A future for when the request is finished.

§ operator=() [1/2]

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

§ operator=() [2/2]

SchemePlugin& shaka::SchemePlugin::operator= ( SchemePlugin &&  )
delete

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