Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

These APIs are exposed on the WebSocket server but are a separate set of APIs. Using Remoteview, you can control the player remotely through the WebSocket channel. This is a route between each configured player and the BSN network.

To use these APIs, you must have confirmed access to a WebRTC signaling server, and access to that server through a browser so you can use the necessary URL endpoints. You must also be authenticated with the necessary BSN server and the player must be registered with that same network.

The web server must provide its content over an HTTPS connection (this is part of the WebRTC specification). If you do not have access to such a service, you can proxy a local (non-HTTPS) server through a remote service. This service is not part of BSN.cloud.

Establishing a Remoteview Player Connection

  1. Acquire an accessURL for a rendezvous service to use with Remoteview.

  2. Use PUT /remoteview/config to add the accessURL to the player configuration in BSN.cloud

  3. Confirm the setting with the GET /remoteview/config endpoint.

  4. Use the POST /remoteview/{:source}/view endpoint to start a session

  5. Go to a Chrome browser and enter the rendezvous forwarding address and add webrtc_client.html to the end of the address (for example: 7a24dceefaa4.ngrok.io/webrtc_client.html)

  6. Enter the player serial number that you wish to view.

  7. You can check to make sure everything is working by using GET /remoteview/{:source}/view. It should return a session id.

  8. Use DELETE  /remoteview/{:source}/view

...

Endpoints:

Table of Contents
minLevel1
maxLevel2
outlinefalse
indent20px
typelist
printablefalse
  1. /{:id} to remove a session.

GET  /remoteview/config/ 

Use the PUT endpoint to configure the player with an access URL. You can then use this endpoint to check that the configuration is correct.

______________________________________________________________

...

Success Response Body

200: This will return the access URL

Example

Code Block
languagejson
{“accessURL”: “http://test-server-url/”}

Failure Response

400: The request is malformed and therefore invalid

401: The access token is invalid or not specified

5XX: Any 500 code is an internal server error

PUT  /remoteview/config/ 

Configures the player with the access URL

Request Body

accessURL string

The remote view server URL

______________________________________________________________

Request Example

Code Block
languagejs
{"data": {“accessURL”: “http://test-server-url/”}}

______________________________________________________________

...

Success Response Body

200: This returns the access URL - the same value that you passed in the request body to the player

Failure Response

400: Either the request or request body is malformed and therefore invalid

401: The access token is invalid or not specified

5XX: Any 500 code is an internal server error

GET  /remoteview/{:source}/view/ 

Returns the information about all the active remote view sessions.

Request Body

source string

This value will always be "desktop"

______________________________________________________________

...

Success Response Body

200: Returns an array of session objects. Each object contains the following parameters:

  • id string: The session id

  • mediaSource string: The value is always "desktop"

  • available bool: This value is always true when the session is active.

  • viewing bool: This indicates that the session is active. The value will always be true.

Example

Code Block
{
      id: "9e61ac20-2014-11ee-a14d-73a9c31db7cd", 
      mediaSource: "desktop", 
      available: true,
      viewing: true
}

Failure Response

400: The request is malformed and therefore invalid

401: The access token is invalid or not specified

5XX: Any 500 code is an internal server error

GET  /remoteview/{:source}/view/:id/ 

Returns information about the specified remote view session using its session id

Request Body

source string

This value will always be "desktop"

 

id string

The unique identifier for the session

______________________________________________________________

Response

Success Response Body

200: Returns the following specified session object:

  • id string: The session id

  • mediaSource string: This value is always "desktop"

  • availablebool: This value is always true when the session is active.

  • viewing bool: This indicates that the session is active. The value will always be true.

Example

Code Block
languagejson
{
      id: "9e61ac20-2014-11ee-a14d-73a9c31db7cd", 
      mediaSource: "desktop", 
      available: true,
      viewing: true
}

Failure Response

400: The request is malformed and therefore invalid

401: The access token is invalid or not specified

404: The specified session id was not found

5XX: Any 500 code is an internal server error

POST  /remoteview/{:source}/view/ 

Starts a new session and returns an id for the session (at this point, the signaling server has been initialized and has made a WebSocket connection to the player)

Request Body

source string

This value will always be "desktop"

______________________________________________________________

Response

Success Response Body

200: A successful response returns the session id.

Example

Code Block
languagejson
{sessionID: "9e61ac20-2014-11ee-a14d-73a9c31db7cd"}

Failure Response

400: The request or request body is malformed and therefore invalid

401: The access token is invalid or not specified

5XX: Any 500 code is an internal server error

DELETE  /remoteview/{:source}/view/:id/ 

Stops the specified remote view session using its session id

Request Body

source string

This value will always be "desktop"

id string

The unique identifier for the session you want to stop

______________________________________________________________

...

Success Response Body

200: The specified session was stopped

Example

Code Block
languagejson
{ stopped : true }

Failure Response

400: The request is malformed and therefore invalid

401: The access token is invalid or not specified

404: The specified session id was not found

5XX: Any 500 code is an internal server error