Class ApideoCamera
public
class
ApideoCamera
Function Details
function onCameraMuted
public
boolean
onCameraMuted(Object
callback)
Example usage:
camera.onCameraMuted(function() {
... your code goes here ...
});
The scope of the function is the current camera, so "this" in the function refers to the ApideoCamera object.
callback
function onCameraStarted
public
boolean
onCameraStarted(Object
callback)
Example usage:
camera.onCameraStarted(function() {
... your code goes here ...
});
The scope of the function is the current camera, so "this" in the function refers to the ApideoCamera object.
Note: if the user clicks "No", you can catch the ApideoCamera.onCameraMuted event.
callback
function onError
public
void
onError(Object
callback)
Please note that if there is no event handler defined for the camera stream, the error is forwarded to the room. As soon as you define one event handler, the error event will no more be forwarded.
Example usage:
camera.onError(function(category, type, msg) {
... your code goes here ...
});
The scope of the function is the current camera, so "this" in the function refers to the ApideoCamera object.
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.
- limit - You reached an Apideo limit. You might have exceeded the number of maximum simultaneous streams received, exceeded the maximum resolution/bandwidth, etc...
callback
function onSecurityError
public
boolean
onSecurityError(Object
callback)
Access to a stream can be rejected if the token settings prevent access to publishing the stream (see Token-based security).
Please note that if there is no security error event handler defined for the camera stream, the error is forwarded to the security event handler of the room. As soon as you define one event handler, the error event will no more be forwarded.
Example usage:
camera.onSecurityError(function(category, type, msg) {
... your code goes here ...
});
The scope of the function is the current camera, so "this" in the function refers to the ApideoCamera object.
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.
callback
function onUploadBandwidthMeasured
public
boolean
onUploadBandwidthMeasured(Object
callback)
Example usage:
camera.onUploadBandwidthMeasured(function(uploadBandwidth, latency) {
... your code goes here ...
});
The scope of the function is the current camera, so "this" in the function refers to the ApideoCamera object.
callback
function resize
public
void
resize(Object
width, Object
height)
The passed value are expressed in pixel.
You can also pass percentages, for instance:
camera.resize("100%", "100%");
If you pass percentages, the size used will be relative to the camera container. Please be sure to set the width and height of the container.
width
height
function unregisterOnCameraMuted
public
boolean
unregisterOnCameraMuted(Object
callback)
callback
function unregisterOnCameraStarted
public
boolean
unregisterOnCameraStarted(Object
callback)
callback
function unregisterOnError
public
void
unregisterOnError(Object
callback)
callback
function unregisterOnSecurityError
public
boolean
unregisterOnSecurityError(Object
callback)
callback
function unregisterOnUploadBandwidthMeasured
public
boolean
unregisterOnUploadBandwidthMeasured(Object
callback)
callback



The Camera object is returned by ApideoRoom.startCamera.
In this release, the Camera object does not have any method. However, you have to keep a reference to this object if you want to be able to close a camera, using the ApideoRoom.removeCamera method.