diff --git a/JitsiMeetJS.js b/JitsiMeetJS.js index 24d5be77e..9a756fd60 100644 --- a/JitsiMeetJS.js +++ b/JitsiMeetJS.js @@ -67,9 +67,21 @@ var LibJitsiMeet = { return tracks; }); }, + /** + * Checks if its possible to enumerate available cameras/micropones. + * @returns {boolean} true if available, false otherwise. + */ isDeviceListAvailable: function () { return RTC.isDeviceListAvailable(); }, + /** + * Returns true if changing the camera / microphone device is supported and + * false if not. + * @returns {boolean} true if available, false otherwise. + */ + isDeviceChangeAvailable: function () { + return RTC.isDeviceChangeAvailable(); + }, enumerateDevices: function (callback) { RTC.enumerateDevices(callback); } diff --git a/lib-jitsi-meet.js b/lib-jitsi-meet.js index d76301bef..be45e03c3 100644 --- a/lib-jitsi-meet.js +++ b/lib-jitsi-meet.js @@ -901,6 +901,9 @@ var LibJitsiMeet = { isDeviceListAvailable: function () { return RTC.isDeviceListAvailable(); }, + isDeviceChangeAvailable: function () { + return RTC.isDeviceChangeAvailable(); + }, enumerateDevices: function (callback) { RTC.enumerateDevices(callback); } @@ -1985,10 +1988,21 @@ RTC.getVideoSrc = function (element) { return RTCUtils.getVideoSrc(element); }; +/** + * Returns true if retrieving the the list of input devices is supported and + * false if not. + */ RTC.isDeviceListAvailable = function () { return RTCUtils.isDeviceListAvailable(); }; +/** + * Returns true if changing the camera / microphone device is supported and + * false if not. + */ +RTC.isDeviceChangeAvailable = function () { + return RTCUtils.isDeviceChangeAvailable(); +} /** * Allows to receive list of available cameras/microphones. * @param {function} callback would receive array of devices as an argument @@ -2946,6 +2960,16 @@ var RTCUtils = { } return (MediaStreamTrack && MediaStreamTrack.getSources)? true : false; }, + /** + * Returns true if changing the camera / microphone device is supported and + * false if not. + */ + isDeviceChangeAvailable: function () { + if(RTCBrowserType.isChrome() || RTCBrowserType.isOpera() || + RTCBrowserType.isTemasysPluginUsed()) + return true; + return false; + }, /** * A method to handle stopping of the stream. * One point to handle the differences in various implementations. diff --git a/modules/RTC/RTC.js b/modules/RTC/RTC.js index c1839020a..92ce662ce 100644 --- a/modules/RTC/RTC.js +++ b/modules/RTC/RTC.js @@ -159,10 +159,21 @@ RTC.getVideoSrc = function (element) { return RTCUtils.getVideoSrc(element); }; +/** + * Returns true if retrieving the the list of input devices is supported and + * false if not. + */ RTC.isDeviceListAvailable = function () { return RTCUtils.isDeviceListAvailable(); }; +/** + * Returns true if changing the camera / microphone device is supported and + * false if not. + */ +RTC.isDeviceChangeAvailable = function () { + return RTCUtils.isDeviceChangeAvailable(); +} /** * Allows to receive list of available cameras/microphones. * @param {function} callback would receive array of devices as an argument diff --git a/modules/RTC/RTCUtils.js b/modules/RTC/RTCUtils.js index a6f474861..1d3f9fa8b 100644 --- a/modules/RTC/RTCUtils.js +++ b/modules/RTC/RTCUtils.js @@ -736,6 +736,16 @@ var RTCUtils = { } return (MediaStreamTrack && MediaStreamTrack.getSources)? true : false; }, + /** + * Returns true if changing the camera / microphone device is supported and + * false if not. + */ + isDeviceChangeAvailable: function () { + if(RTCBrowserType.isChrome() || RTCBrowserType.isOpera() || + RTCBrowserType.isTemasysPluginUsed()) + return true; + return false; + }, /** * A method to handle stopping of the stream. * One point to handle the differences in various implementations.