Checks if the browser supports screen-sharing. Desktop Chrome, Firefox and Opera support screen-sharing
1 if the browser supports screen-sharing, 0 otherwise
Checks if the browser supports OpenVidu
1 if the browser supports OpenVidu, 0 otherwise
Disable all logging except error level
Collects information about the media input devices available on the system. You can pass property deviceId of a Device object as value of audioSource or videoSource properties in initPublisher method
Get a MediaStream object that you can customize before calling initPublisher (pass MediaStreamTrack property of the MediaStream value resolved by the Promise as audioSource or videoSource properties in initPublisher)
Parameter options is the same as in initPublisher second parameter (of type PublisherProperties), but only the following properties will be applied: audioSource, videoSource, frameRate, resolution
To customize the Publisher's video, the API for HTMLCanvasElement is very useful. For example, to get a black-and-white video at 10 fps and HD resolution with no sound:
var OV = new OpenVidu();
var FRAME_RATE = 10;
OV.getUserMedia({
audioSource: false,
videoSource: undefined,
resolution: '1280x720',
frameRate: FRAME_RATE
})
.then(mediaStream => {
var videoTrack = mediaStream.getVideoTracks()[0];
var video = document.createElement('video');
video.srcObject = new MediaStream([videoTrack]);
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
ctx.filter = 'grayscale(100%)';
video.addEventListener('play', () => {
var loop = () => {
if (!video.paused && !video.ended) {
ctx.drawImage(video, 0, 0, 300, 170);
setTimeout(loop, 1000/ FRAME_RATE); // Drawing at 10 fps
}
};
loop();
});
video.play();
var grayVideoTrack = canvas.captureStream(FRAME_RATE).getVideoTracks()[0];
var publisher = this.OV.initPublisher(
myHtmlTarget,
{
audioSource: false,
videoSource: grayVideoTrack
});
});
Returns a new local recorder for recording streams straight away from the browser
Stream to record
Promisified version of OpenVidu.initPublisher
WARNING: events
accessDialogOpenedandaccessDialogClosedwill not be dispatched if using this method instead of OpenVidu.initPublisher
Promisified version of OpenVidu.initPublisher
WARNING: events
accessDialogOpenedandaccessDialogClosedwill not be dispatched if using this method instead of OpenVidu.initPublisher
Returns new session
Set OpenVidu advanced configuration options. configuration is an object of type OpenViduAdvancedConfiguration. Call this method to override previous values at any moment.
Entrypoint of OpenVidu Browser library. Use it to initialize objects of type Session, Publisher and LocalRecorder