|
|
@@ -2089,7 +2089,12 @@ isAndroid = navigator.userAgent.indexOf('Android') != -1;
|
|
2089
|
2089
|
module.exports = RTCBrowserType;
|
|
2090
|
2090
|
},{}],18:[function(require,module,exports){
|
|
2091
|
2091
|
(function (__filename){
|
|
2092
|
|
-/* global config, require, attachMediaStream, getUserMedia */
|
|
|
2092
|
+/* global config, require, attachMediaStream, getUserMedia,
|
|
|
2093
|
+ RTCPeerConnection, RTCSessionDescription, RTCIceCandidate, MediaStreamTrack,
|
|
|
2094
|
+ mozRTCPeerConnection, mozRTCSessionDescription, mozRTCIceCandidate,
|
|
|
2095
|
+ webkitRTCPeerConnection, webkitMediaStream, webkitURL
|
|
|
2096
|
+*/
|
|
|
2097
|
+/* jshint -W101 */
|
|
2093
|
2098
|
|
|
2094
|
2099
|
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
|
2095
|
2100
|
var RTCBrowserType = require("./RTCBrowserType");
|
|
|
@@ -2106,7 +2111,7 @@ var eventEmitter = new EventEmitter();
|
|
2106
|
2111
|
var devices = {
|
|
2107
|
2112
|
audio: true,
|
|
2108
|
2113
|
video: true
|
|
2109
|
|
-}
|
|
|
2114
|
+};
|
|
2110
|
2115
|
|
|
2111
|
2116
|
var rtcReady = false;
|
|
2112
|
2117
|
|
|
|
@@ -2286,7 +2291,7 @@ function onReady (options, GUM) {
|
|
2286
|
2291
|
rtcReady = true;
|
|
2287
|
2292
|
eventEmitter.emit(RTCEvents.RTC_READY, true);
|
|
2288
|
2293
|
screenObtainer.init(eventEmitter, options, GUM);
|
|
2289
|
|
-};
|
|
|
2294
|
+}
|
|
2290
|
2295
|
|
|
2291
|
2296
|
/**
|
|
2292
|
2297
|
* Apply function with arguments if function exists.
|
|
|
@@ -2414,8 +2419,8 @@ function enumerateDevicesThroughMediaStreamTrack (callback) {
|
|
2414
|
2419
|
}
|
|
2415
|
2420
|
|
|
2416
|
2421
|
function obtainDevices(options) {
|
|
2417
|
|
- if(!options.devices || options.devices.length === 0) {
|
|
2418
|
|
- return options.successCallback(streams);
|
|
|
2422
|
+ if (!options.devices || options.devices.length === 0) {
|
|
|
2423
|
+ return options.successCallback(options.streams);
|
|
2419
|
2424
|
}
|
|
2420
|
2425
|
|
|
2421
|
2426
|
var device = options.devices.splice(0, 1);
|
|
|
@@ -2455,8 +2460,8 @@ function handleLocalStream(streams, resolution) {
|
|
2455
|
2460
|
var videoTracks = audioVideo.getVideoTracks();
|
|
2456
|
2461
|
if(videoTracks.length) {
|
|
2457
|
2462
|
videoStream = new webkitMediaStream();
|
|
2458
|
|
- for (i = 0; i < videoTracks.length; i++) {
|
|
2459
|
|
- videoStream.addTrack(videoTracks[i]);
|
|
|
2463
|
+ for (var j = 0; j < videoTracks.length; j++) {
|
|
|
2464
|
+ videoStream.addTrack(videoTracks[j]);
|
|
2460
|
2465
|
}
|
|
2461
|
2466
|
}
|
|
2462
|
2467
|
}
|
|
|
@@ -2595,7 +2600,7 @@ var RTCUtils = {
|
|
2595
|
2600
|
|
|
2596
|
2601
|
//AdapterJS.WebRTCPlugin.setLogLevel(
|
|
2597
|
2602
|
// AdapterJS.WebRTCPlugin.PLUGIN_LOG_LEVELS.VERBOSE);
|
|
2598
|
|
-
|
|
|
2603
|
+ var self = this;
|
|
2599
|
2604
|
AdapterJS.webRTCReady(function (isPlugin) {
|
|
2600
|
2605
|
|
|
2601
|
2606
|
self.peerconnection = RTCPeerConnection;
|
|
|
@@ -2653,7 +2658,7 @@ var RTCUtils = {
|
|
2653
|
2658
|
|
|
2654
|
2659
|
// Call onReady() if Temasys plugin is not used
|
|
2655
|
2660
|
if (!RTCBrowserType.isTemasysPluginUsed()) {
|
|
2656
|
|
- onReady(options, self.getUserMediaWithConstraints);
|
|
|
2661
|
+ onReady(options, this.getUserMediaWithConstraints);
|
|
2657
|
2662
|
resolve();
|
|
2658
|
2663
|
}
|
|
2659
|
2664
|
}.bind(this));
|
|
|
@@ -2672,9 +2677,8 @@ var RTCUtils = {
|
|
2672
|
2677
|
**/
|
|
2673
|
2678
|
getUserMediaWithConstraints: function ( um, success_callback, failure_callback, options) {
|
|
2674
|
2679
|
options = options || {};
|
|
2675
|
|
- resolution = options.resolution;
|
|
2676
|
|
- var constraints = getConstraints(
|
|
2677
|
|
- um, options);
|
|
|
2680
|
+ var resolution = options.resolution;
|
|
|
2681
|
+ var constraints = getConstraints(um, options);
|
|
2678
|
2682
|
|
|
2679
|
2683
|
logger.info("Get media constraints", constraints);
|
|
2680
|
2684
|
|
|
|
@@ -2731,12 +2735,12 @@ var RTCUtils = {
|
|
2731
|
2735
|
RTCBrowserType.isTemasysPluginUsed()) {
|
|
2732
|
2736
|
var GUM = function (device, s, e) {
|
|
2733
|
2737
|
this.getUserMediaWithConstraints(device, s, e, options);
|
|
2734
|
|
- }
|
|
|
2738
|
+ };
|
|
2735
|
2739
|
var deviceGUM = {
|
|
2736
|
2740
|
"audio": GUM.bind(self, ["audio"]),
|
|
2737
|
2741
|
"video": GUM.bind(self, ["video"]),
|
|
2738
|
2742
|
"desktop": screenObtainer.obtainStream
|
|
2739
|
|
- }
|
|
|
2743
|
+ };
|
|
2740
|
2744
|
// With FF/IE we can't split the stream into audio and video because FF
|
|
2741
|
2745
|
// doesn't support media stream constructors. So, we need to get the
|
|
2742
|
2746
|
// audio stream separately from the video stream using two distinct GUM
|
|
|
@@ -2747,13 +2751,14 @@ var RTCUtils = {
|
|
2747
|
2751
|
// the successCallback method.
|
|
2748
|
2752
|
obtainDevices({
|
|
2749
|
2753
|
devices: options.devices,
|
|
|
2754
|
+ streams: [],
|
|
2750
|
2755
|
successCallback: successCallback,
|
|
2751
|
2756
|
errorCallback: reject,
|
|
2752
|
2757
|
deviceGUM: deviceGUM
|
|
2753
|
2758
|
});
|
|
2754
|
2759
|
} else {
|
|
2755
|
|
- var hasDesktop = false;
|
|
2756
|
|
- if(hasDesktop = options.devices.indexOf("desktop") !== -1) {
|
|
|
2760
|
+ var hasDesktop = options.devices.indexOf('desktop') > -1;
|
|
|
2761
|
+ if (hasDesktop) {
|
|
2757
|
2762
|
options.devices.splice(options.devices.indexOf("desktop"), 1);
|
|
2758
|
2763
|
}
|
|
2759
|
2764
|
options.resolution = options.resolution || '360';
|