From 1153ee365276f4890beb4c37b153c5d4455c9bec Mon Sep 17 00:00:00 2001 From: Alexey Khit Date: Fri, 3 Feb 2023 11:39:53 +0300 Subject: [PATCH] Fix support WebRTC for Chromecast 1 --- www/README.md | 13 +++++++++++++ www/video-rtc.js | 5 ++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/www/README.md b/www/README.md index 79d93b45..cb34a782 100644 --- a/www/README.md +++ b/www/README.md @@ -48,6 +48,18 @@ pc.ontrack = ev => { } ``` +## Chromecast 1 + +2023-02-02. Error: + +``` +InvalidStateError: Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'. 'unified-plan' will become the default behavior in the future, but it is currently experimental. To try it out, construct the RTCPeerConnection with sdpSemantics:'unified-plan' present in the RTCConfiguration argument. +``` + +User-Agent: `Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.47 Safari/537.36 CrKey/1.36.159268` + +https://webrtc.org/getting-started/unified-plan-transition-guide?hl=en + ## Useful links - https://www.webrtc-experiment.com/DetectRTC/ @@ -58,3 +70,4 @@ pc.ontrack = ev => { - https://chromium.googlesource.com/external/w3c/web-platform-tests/+/refs/heads/master/media-source/mediasource-is-type-supported.html - https://googlechrome.github.io/samples/media/sourcebuffer-changetype.html - https://chromestatus.com/feature/5100845653819392 +- https://developer.apple.com/documentation/webkit/delivering_video_content_for_safari diff --git a/www/video-rtc.js b/www/video-rtc.js index 1becffdf..445aa94d 100644 --- a/www/video-rtc.js +++ b/www/video-rtc.js @@ -61,7 +61,10 @@ export class VideoRTC extends HTMLElement { * [config] WebRTC configuration * @type {RTCConfiguration} */ - this.pcConfig = {iceServers: [{urls: "stun:stun.l.google.com:19302"}]}; + this.pcConfig = { + iceServers: [{urls: 'stun:stun.l.google.com:19302'}], + sdpSemantics: 'unified-plan', // important for Chromecast 1 + }; /** * [info] WebSocket connection state. Values: CONNECTING, OPEN, CLOSED