...
Code Block |
---|
|
previewStream.getStats(function (stats) {
if (stats && stats.inboundStream) {
if(stats.inboundStream.videoStats) {
$('#inVideoStatBytesReceived').text(stats.inboundStream.videoStats.bytesReceived);
$('#inVideoStatPacketsReceived').text(stats.inboundStream.videoStats.packetsReceived);
$('#inVideoStatFramesDecoded').text(stats.inboundStream.videoStats.framesDecoded);
} else {
...
}
if(stats.inboundStream.audioStats) {
$('#inAudioStatBytesReceived').text(stats.inboundStream.audioStats.bytesReceived);
$('#inAudioStatPacketsReceived').text(stats.inboundStream.audioStats.packetsReceived);
} else {
...
}
}
}); |
Picture parameters management
When video stream is published, it is possible to manage picture resolution and frame rate with constraints.
Picture resolution management
Pucture resolution can be exactly set
Code Block |
---|
|
constraints = {audio:true, video:{width:320,height:240}} |
However, in some cases it is necessary to set height and width as range
Code Block |
---|
|
constraints = {audio:true, video:{width:{min:160,max:320},height:{min:120,max:240}}} |
For some browsers, iOS Safari for example, exact values should be set as range (in last versions there is a workaround on WebSDK level)
Code Block |
---|
|
constraints = {audio:true, video:{width:{min:320,max:320},height:{min:240,max:240}}} |
Frame rate management
Frame rate can be set exactly
Code Block |
---|
|
constraints = {audio:true, video:{frameRate:30} |
or as range
Code Block |
---|
|
constraints = {audio:true, video:{frameRate:{min:15,max:30}} |
In some cases, for example if web camera supports 24 fps only and frame rate is set to 30 fps then stream publishing will fail. In this case frame rate should be set as ideal
Code Block |
---|
|
constraints = {audio:true, video:{frameRate:{ideal:30}} |
Known issues
1. Microphone swithing does not work in Safari browser.
...