Browse Source

Adds isDeviceChangeAvailable method.

master
hristoterezov 9 years ago
parent
commit
c2606b1483
4 changed files with 57 additions and 0 deletions
  1. 12
    0
      JitsiMeetJS.js
  2. 24
    0
      lib-jitsi-meet.js
  3. 11
    0
      modules/RTC/RTC.js
  4. 10
    0
      modules/RTC/RTCUtils.js

+ 12
- 0
JitsiMeetJS.js View File

@@ -67,9 +67,21 @@ var LibJitsiMeet = {
67 67
                 return tracks;
68 68
             });
69 69
     },
70
+    /**
71
+     * Checks if its possible to enumerate available cameras/micropones.
72
+     * @returns {boolean} true if available, false otherwise.
73
+     */
70 74
     isDeviceListAvailable: function () {
71 75
         return RTC.isDeviceListAvailable();
72 76
     },
77
+    /**
78
+     * Returns true if changing the camera / microphone device is supported and
79
+     * false if not.
80
+     * @returns {boolean} true if available, false otherwise.
81
+     */
82
+    isDeviceChangeAvailable: function () {
83
+        return RTC.isDeviceChangeAvailable();
84
+    },
73 85
     enumerateDevices: function (callback) {
74 86
         RTC.enumerateDevices(callback);
75 87
     }

+ 24
- 0
lib-jitsi-meet.js View File

@@ -901,6 +901,9 @@ var LibJitsiMeet = {
901 901
     isDeviceListAvailable: function () {
902 902
         return RTC.isDeviceListAvailable();
903 903
     },
904
+    isDeviceChangeAvailable: function () {
905
+        return RTC.isDeviceChangeAvailable();
906
+    },
904 907
     enumerateDevices: function (callback) {
905 908
         RTC.enumerateDevices(callback);
906 909
     }
@@ -1985,10 +1988,21 @@ RTC.getVideoSrc = function (element) {
1985 1988
     return RTCUtils.getVideoSrc(element);
1986 1989
 };
1987 1990
 
1991
+/**
1992
+ * Returns true if retrieving the the list of input devices is supported and
1993
+ * false if not.
1994
+ */
1988 1995
 RTC.isDeviceListAvailable = function () {
1989 1996
     return RTCUtils.isDeviceListAvailable();
1990 1997
 };
1991 1998
 
1999
+/**
2000
+ * Returns true if changing the camera / microphone device is supported and
2001
+ * false if not.
2002
+ */
2003
+RTC.isDeviceChangeAvailable = function () {
2004
+    return RTCUtils.isDeviceChangeAvailable();
2005
+}
1992 2006
 /**
1993 2007
  * Allows to receive list of available cameras/microphones.
1994 2008
  * @param {function} callback would receive array of devices as an argument
@@ -2946,6 +2960,16 @@ var RTCUtils = {
2946 2960
         }
2947 2961
         return (MediaStreamTrack && MediaStreamTrack.getSources)? true : false;
2948 2962
     },
2963
+    /**
2964
+     * Returns true if changing the camera / microphone device is supported and
2965
+     * false if not.
2966
+     */
2967
+    isDeviceChangeAvailable: function () {
2968
+        if(RTCBrowserType.isChrome() || RTCBrowserType.isOpera() ||
2969
+            RTCBrowserType.isTemasysPluginUsed())
2970
+            return true;
2971
+        return false;
2972
+    },
2949 2973
     /**
2950 2974
      * A method to handle stopping of the stream.
2951 2975
      * One point to handle the differences in various implementations.

+ 11
- 0
modules/RTC/RTC.js View File

@@ -159,10 +159,21 @@ RTC.getVideoSrc = function (element) {
159 159
     return RTCUtils.getVideoSrc(element);
160 160
 };
161 161
 
162
+/**
163
+ * Returns true if retrieving the the list of input devices is supported and
164
+ * false if not.
165
+ */
162 166
 RTC.isDeviceListAvailable = function () {
163 167
     return RTCUtils.isDeviceListAvailable();
164 168
 };
165 169
 
170
+/**
171
+ * Returns true if changing the camera / microphone device is supported and
172
+ * false if not.
173
+ */
174
+RTC.isDeviceChangeAvailable = function () {
175
+    return RTCUtils.isDeviceChangeAvailable();
176
+}
166 177
 /**
167 178
  * Allows to receive list of available cameras/microphones.
168 179
  * @param {function} callback would receive array of devices as an argument

+ 10
- 0
modules/RTC/RTCUtils.js View File

@@ -736,6 +736,16 @@ var RTCUtils = {
736 736
         }
737 737
         return (MediaStreamTrack && MediaStreamTrack.getSources)? true : false;
738 738
     },
739
+    /**
740
+     * Returns true if changing the camera / microphone device is supported and
741
+     * false if not.
742
+     */
743
+    isDeviceChangeAvailable: function () {
744
+        if(RTCBrowserType.isChrome() || RTCBrowserType.isOpera() ||
745
+            RTCBrowserType.isTemasysPluginUsed())
746
+            return true;
747
+        return false;
748
+    },
739 749
     /**
740 750
      * A method to handle stopping of the stream.
741 751
      * One point to handle the differences in various implementations.

Loading…
Cancel
Save