diff --git a/doc/client_api.md b/doc/client_api.md index 5ed7aac37b..b5dba51709 100644 --- a/doc/client_api.md +++ b/doc/client_api.md @@ -219,7 +219,7 @@ The attributes variable is usually a JSON object. ``` var stream = Erizo.Stream({audio:true, video:false, data: true, attributes: {name:'myStream', type:'public'}}); - + var attributes = stream.getAttributes(); if(attributes.type === 'public') { console.log(attributes.name); @@ -256,19 +256,19 @@ The client can get the bitmap raw data from the video streams. The Stream return var bitmap; var canvas = document.createElement('canvas'); var context = canvas.getContext('2d'); - + canvas.id = "testCanvas"; document.body.appendChild(canvas); - + setInterval(function() { - + bitmap = stream.getVideoFrame(); - + canvas.width = bitmap.width; canvas.height = bitmap.height; - + context.putImageData(bitmap, 0, 0); - + }, 100); ``` @@ -288,13 +288,13 @@ You can update the maximun bandwidth of video and audio. These values are define ``` var config = {maxVideoBW: 300, maxAudioBW: 300}; - + localstream.updateConfiguration(config, function(result) { console.log(result); }); - + // We can update options also on a remote stream - + remoteStream.updateConfiguration({slideShowMode:true}, function (result){ console.log(result); }); @@ -750,6 +750,7 @@ There are the different types of Stream events: - `streamEvent.bandwidth` is the available bandwidth reported by that stream. - `streamEvent.msg` the status of that stream, depends on the adaptation [scheme](#schemes). - *stream-failed*: A stream has failed, either in the connection establishment or during the communication. +- *stream-ended*: A track of the stream (specified in the msg. es.audio/video) is ended, probably caused by an hardware disconnection. Emitted only once They all are dispatched by Room objects. @@ -775,11 +776,11 @@ room.addEventListener("stream-removed", function(evt){...}); ``` stream.addEventListener("access-accepted", function(evt){...}); - + stream.addEventListener("stream-data", function(evt){ console.log('Received data ', evt.msg, 'from stream ', evt.stream.getAttributes().name); }); - + room.addEventListener("stream-attributes-update", function(evt){...}); ``` @@ -799,14 +800,14 @@ In this example we will make a basic videoconference application. Every client t