• English
  • Français

Class Apideo


public class Apideo
The Apideo object is the first object used by any Apideo application. Using it's connect function, you will connect to the Apideo servers.
Defined in apideo.js

Function Summary
public static ApideoConnection connect (string key)
Connects to Apideo, using your Apideo Key.
public void onError (Object callback)
Registers a callback function that will be called if an error occurs in Apideo.
public void unregisterOnError (Object callback)
Unregisters a callback function that is called when an uncatched error occurs in Apideo.

Function Details

function connect

public static ApideoConnection connect(string key)
Connects to Apideo, using your Apideo Key. Your Apideo Key is the 18 characters key that has been sent to you when you subscribed to the Apideo service. The call will return an ApideoConnection object.
Parameters:
key - Your Apideo key.
Returns:
The ApideoConnection object you will use to connect to a room.

function onError

public void onError(Object callback)
Registers a callback function that will be called if an error occurs in Apideo.

The event handler will catch any error that has not been catched by more specialized event handlers (for instance, by room error event handlers, camera error event handlers or viewers error event handlers).

For more specialized error event handlers, please see ApideoRoom.onError, ApideoCamera.onError and ApideoViewer.onError functions.

Please note that if there is no default event handler, Apideo will provide a default one: a simple alert box will be displayed. As soon as you define one event handler, the default event handler is discarded.

Example usage:

 Apideo.onError(function(category, type, msg) {
 		... your code goes here ...
 });
 

The parameters passed to the callback function are:

  • category {string} - The category of the error.
  • type {string} - The technical type of the error.
  • msg {string} - The message of the error.

The most important parameter is the category. It can be one of:

  • connect - An error occured while connecting to the room.
  • disconnect - An connection error occured: the room has been disconnected.
  • error - An internal error occured.
  • server - An error occured on the server-side.
  • camera - An error occured with a camera started in this room. This kind of error is thrown only if no event handler is attached to the camera.
  • viewer - An error occured with a stream viewed in this room. This kind of error is thrown only if no event handler is attached to the stream played.
Parameters:
callback

function unregisterOnError

public void unregisterOnError(Object callback)
Unregisters a callback function that is called when an uncatched error occurs in Apideo.
Parameters:
callback