|
@@ -281,9 +281,23 @@ export default class BrowserCapabilities extends BrowserDetection {
|
281
|
281
|
* @returns {boolean} {@code true} if the browser supports insertable streams.
|
282
|
282
|
*/
|
283
|
283
|
supportsInsertableStreams() {
|
284
|
|
- return Boolean(typeof window.RTCRtpSender !== 'undefined'
|
|
284
|
+ if (!(typeof window.RTCRtpSender !== 'undefined'
|
285
|
285
|
&& (window.RTCRtpSender.prototype.createEncodedStreams
|
286
|
|
- || window.RTCRtpSender.prototype.createEncodedVideoStreams));
|
|
286
|
+ || window.RTCRtpSender.prototype.createEncodedVideoStreams))) {
|
|
287
|
+ return false;
|
|
288
|
+ }
|
|
289
|
+
|
|
290
|
+ // Feature-detect transferable streams which we need to operate in a worker.
|
|
291
|
+ // See https://groups.google.com/a/chromium.org/g/blink-dev/c/1LStSgBt6AM/m/hj0odB8pCAAJ
|
|
292
|
+ const stream = new ReadableStream();
|
|
293
|
+
|
|
294
|
+ try {
|
|
295
|
+ window.postMessage(stream, '*', [ stream ]);
|
|
296
|
+
|
|
297
|
+ return true;
|
|
298
|
+ } catch {
|
|
299
|
+ return false;
|
|
300
|
+ }
|
287
|
301
|
}
|
288
|
302
|
|
289
|
303
|
/**
|