]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11285: OverconstrainedError on some Android front cameras when frameRate.min is...
authorChad Phillips <chad@apartmentlines.com>
Thu, 26 Jul 2018 20:02:29 +0000 (15:02 -0500)
committerChad Phillips <chad@apartmentlines.com>
Thu, 26 Jul 2018 20:02:29 +0000 (15:02 -0500)
As described at https://bugs.chromium.org/p/chromium/issues/detail?id=862325,
some Android devices using Chrome fail a getUserMedia() request when
frameRate.min is specified.

This is due to a bug in both the device (reporting a 0 min frameRate), and
Chrome, which fails to catch this and set a reasonable fallback value.

While a fix has gone into Chrome, it might be awhile before this fix makes it
into their stable release, so filing this with my quick hack to prevent the
error on Android devices.

Note this fix could certainly be more robust (maybe detect Chrome version, or
some test to see if min frameRate from the device returns 0), and it gets the
job done as a start.

html5/verto/js/src/jquery.FSRTC.js

index c2ea803d0bc232478cc884ddf5eb0560a20714ba..4bda993e468e6c777e16ab70ce03462653977aaa 100644 (file)
                    mandatory: obj.options.videoParams,
                    optional: opt               
                };
+          // NOTE: This is a workaround for
+          // https://bugs.chromium.org/p/chromium/issues/detail?id=862325
+          if (!!navigator.userAgent.match(/Android/i)) {
+            delete video.frameRate.min;
+          }
            }
        } else {