Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

3. Specifying the resolution of the video

code:

Code Block
languagejs
themeRDark
function resizeLocalVideo(event) {
         var requested = constraints.video;
 = {
  if (requested.width != event.target.videoWidth || requested.height != event.target.videoHeight) {
        console.warn("Camera does not support requested resolution, actual resolution is " + event.target.videoWidth + "x" + event.target.videoHeight);deviceId: $('#videoInput').val(),
                width: parseInt($('#sendWidth').val()),
    }
     $("#publishResolution").text(event.target.videoWidth + "x" + event.target.videoHeight);
   height: resizeVideo(event.target);
parseInt($('#sendHeight').val())
            };
            if (Browser.isSafariWebRTC() && Browser.isiOS() && Flashphoner.getMediaProviders()[0] === "WebRTC") {
                constraints.video.deviceId = {exact: $('#videoInput').val()};
                constraints.video.width = {min: parseInt($('#sendWidth').val()), max: 640};
                constraints.video.height = {min: parseInt($('#sendHeight').val()), max: 480};
            }

4. Setting FPS

code:

Code Block
languagejs
themeRDark
   if (constraints.video) {
        if (constraints.customStream) {
            ...
        } else {
            ...
            if (parseInt($('#fps').val()) > 0)
                constraints.video.frameRate = parseInt($('#fps').val());
        }
    }

...