@flashphoner/websdk 2.0.235 → 2.0.236
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docTemplate/README.md +1 -1
- package/flashphoner-no-flash.js +48 -23
- package/flashphoner-no-flash.min.js +2 -2
- package/flashphoner-no-webrtc.js +3 -10
- package/flashphoner-no-webrtc.min.js +2 -2
- package/flashphoner-no-wsplayer.js +48 -23
- package/flashphoner-no-wsplayer.min.js +2 -2
- package/flashphoner-room-api.js +60 -19
- package/flashphoner-room-api.min.js +3 -3
- package/flashphoner-temasys-flash-websocket-without-adapterjs.js +3 -10
- package/flashphoner-temasys-flash-websocket.js +3 -10
- package/flashphoner-temasys-flash-websocket.min.js +1 -1
- package/flashphoner-webrtc-only.js +46 -21
- package/flashphoner-webrtc-only.min.js +1 -1
- package/flashphoner.js +48 -23
- package/flashphoner.min.js +2 -2
- package/package.json +1 -1
- package/src/media-source-media-provider.js +2 -2
- package/src/webrtc-media-provider.js +58 -17
|
@@ -417,6 +417,7 @@ var createConnection = function (options) {
|
|
|
417
417
|
}
|
|
418
418
|
return true;
|
|
419
419
|
};
|
|
420
|
+
|
|
420
421
|
var muteVideo = function () {
|
|
421
422
|
if (localVideo && localVideo.srcObject && localVideo.srcObject.getVideoTracks().length > 0) {
|
|
422
423
|
localVideo.srcObject.getVideoTracks()[0].enabled = false;
|
|
@@ -427,15 +428,17 @@ var createConnection = function (options) {
|
|
|
427
428
|
localVideo.srcObject.getVideoTracks()[0].enabled = true;
|
|
428
429
|
}
|
|
429
430
|
};
|
|
431
|
+
|
|
430
432
|
var isVideoMuted = function () {
|
|
431
433
|
if (localVideo && localVideo.srcObject && localVideo.srcObject.getVideoTracks().length > 0) {
|
|
432
434
|
return !localVideo.srcObject.getVideoTracks()[0].enabled;
|
|
433
435
|
}
|
|
434
436
|
return true;
|
|
435
437
|
};
|
|
438
|
+
|
|
436
439
|
var getStat = function (callbackFn, nativeStats) {
|
|
437
|
-
|
|
438
|
-
|
|
440
|
+
let browser = browserDetails.browser;
|
|
441
|
+
let result = {outboundStream: {}, inboundStream: {}, otherStats: []};
|
|
439
442
|
if (connection && validBrowsers.includes(browser)) {
|
|
440
443
|
if (nativeStats) {
|
|
441
444
|
return connection.getStats(null);
|
|
@@ -444,18 +447,18 @@ var createConnection = function (options) {
|
|
|
444
447
|
if (stat) {
|
|
445
448
|
stat.forEach(function (report) {
|
|
446
449
|
if (!report.isRemote) {
|
|
450
|
+
let mediaType = "";
|
|
447
451
|
if (report.type == 'outbound-rtp') {
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
result.outboundStream[
|
|
452
|
-
result.outboundStream[report.mediaType].width = vSettings.width;
|
|
452
|
+
mediaType = getReportMediaType(report);
|
|
453
|
+
fillStatObject(result.outboundStream, report, mediaType);
|
|
454
|
+
if (mediaType == 'video') {
|
|
455
|
+
getVideoSize(result.outboundStream[mediaType], report);
|
|
453
456
|
}
|
|
454
457
|
} else if (report.type == 'inbound-rtp') {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
result.inboundStream[
|
|
458
|
+
mediaType = getReportMediaType(report);
|
|
459
|
+
fillStatObject(result.inboundStream, report, mediaType);
|
|
460
|
+
if (mediaType == 'video') {
|
|
461
|
+
getVideoSize(result.inboundStream[mediaType], report);
|
|
459
462
|
}
|
|
460
463
|
}
|
|
461
464
|
}
|
|
@@ -468,13 +471,47 @@ var createConnection = function (options) {
|
|
|
468
471
|
}
|
|
469
472
|
};
|
|
470
473
|
|
|
471
|
-
function
|
|
472
|
-
|
|
474
|
+
var getReportMediaType = function (report) {
|
|
475
|
+
// Since Safari 17 report.mediaType is undefined #WCS-3922
|
|
476
|
+
if (report.mediaType !== undefined) {
|
|
477
|
+
return report.mediaType;
|
|
478
|
+
} else if (report.kind !== undefined) {
|
|
479
|
+
return report.kind;
|
|
480
|
+
}
|
|
481
|
+
logger.warn(LOG_PREFIX, "No media type provided in WebRTC statistics");
|
|
482
|
+
return "media";
|
|
483
|
+
};
|
|
484
|
+
|
|
485
|
+
var getVideoSize = function (obj, report) {
|
|
486
|
+
let videoSize = {};
|
|
487
|
+
if (report.type == 'outbound-rtp') {
|
|
488
|
+
if (localVideo !== undefined && localVideo != null) {
|
|
489
|
+
videoSize = localVideo.srcObject.getVideoTracks()[0].getSettings();
|
|
490
|
+
}
|
|
491
|
+
} else if (report.type == 'inbound-rtp') {
|
|
492
|
+
if (remoteVideo !== undefined && remoteVideo != null) {
|
|
493
|
+
videoSize.width = remoteVideo.videoWidth;
|
|
494
|
+
videoSize.height = remoteVideo.videoHeight;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
if (report.frameWidth !== undefined) {
|
|
498
|
+
obj.width = report.frameWidth;
|
|
499
|
+
} else if (videoSize.width !== undefined) {
|
|
500
|
+
obj.width = videoSize.width;
|
|
501
|
+
}
|
|
502
|
+
if (report.frameHeight !== undefined) {
|
|
503
|
+
obj.height = report.frameHeight;
|
|
504
|
+
} else if (videoSize.height !== undefined) {
|
|
505
|
+
obj.height = videoSize.height;
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
var fillStatObject = function (obj, report, mediaType) {
|
|
473
510
|
obj[mediaType] = {};
|
|
474
511
|
//WCS-1922, currentRemoteDescription - browser compatibilitySection: Chrome 70, FF 57, Safari 11
|
|
475
|
-
|
|
512
|
+
let description = connection.currentRemoteDescription != undefined ? connection.currentRemoteDescription : connection.remoteDescription;
|
|
476
513
|
// SDP may be null in Safari 12.1 and older, prevent TypeError here #WCS-3583
|
|
477
|
-
|
|
514
|
+
let sdp = "";
|
|
478
515
|
if (description && description.sdp) {
|
|
479
516
|
sdp = description.sdp;
|
|
480
517
|
} else {
|
|
@@ -485,11 +522,15 @@ var createConnection = function (options) {
|
|
|
485
522
|
obj[mediaType]["codecRate"] = codec.sampleRate;
|
|
486
523
|
Object.keys(report).forEach(function (key) {
|
|
487
524
|
// Add audioLevel parameter parsing #WCS-3290
|
|
488
|
-
if (key.startsWith("bytes") ||
|
|
525
|
+
if (key.startsWith("bytes") ||
|
|
526
|
+
key.startsWith("packets") ||
|
|
527
|
+
key.indexOf("Count") != -1 ||
|
|
528
|
+
key.indexOf("audioLevel") != -1 ||
|
|
529
|
+
key == "framesPerSecond") {
|
|
489
530
|
obj[mediaType][key] = report[key];
|
|
490
531
|
}
|
|
491
532
|
});
|
|
492
|
-
}
|
|
533
|
+
};
|
|
493
534
|
|
|
494
535
|
var fullScreen = function () {
|
|
495
536
|
var video = document.getElementById(id);
|