Some small updates, related to firefox
This commit is contained in:
parent
e9e8e2c69b
commit
18e44faf3c
3 changed files with 29 additions and 5 deletions
2
shared/svg-sprites/client-icons.d.ts
vendored
2
shared/svg-sprites/client-icons.d.ts
vendored
File diff suppressed because one or more lines are too long
|
@ -528,6 +528,16 @@ export class RTCConnection {
|
||||||
return this.retryTimestamp;
|
return this.retryTimestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
restartConnection() {
|
||||||
|
if(this.connectionState === RTPConnectionState.DISCONNECTED) {
|
||||||
|
/* We've been disconnected on purpose */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.reset(true);
|
||||||
|
this.doInitialSetup();
|
||||||
|
}
|
||||||
|
|
||||||
reset(updateConnectionState: boolean) {
|
reset(updateConnectionState: boolean) {
|
||||||
if(this.peer) {
|
if(this.peer) {
|
||||||
if(this.getConnection().connected()) {
|
if(this.getConnection().connected()) {
|
||||||
|
@ -691,11 +701,16 @@ export class RTCConnection {
|
||||||
/* initialize rtc connection */
|
/* initialize rtc connection */
|
||||||
this.retryCalculator.reset();
|
this.retryCalculator.reset();
|
||||||
|
|
||||||
if(!('RTCPeerConnection' in window)) {
|
if(!("RTCPeerConnection" in window)) {
|
||||||
this.handleFatalError(tr("WebRTC has been disabled (RTCPeerConnection is not defined)"), false);
|
this.handleFatalError(tr("WebRTC has been disabled (RTCPeerConnection is not defined)"), false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!("addTransceiver" in RTCPeerConnection.prototype)) {
|
||||||
|
this.handleFatalError(tr("WebRTC api incompatible (RTCPeerConnection.addTransceiver missing)"), false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.peer = new RTCPeerConnection({
|
this.peer = new RTCPeerConnection({
|
||||||
bundlePolicy: "max-bundle",
|
bundlePolicy: "max-bundle",
|
||||||
rtcpMuxPolicy: "require",
|
rtcpMuxPolicy: "require",
|
||||||
|
|
|
@ -10,8 +10,8 @@ interface SdpCodec {
|
||||||
rtcpFb?: string[]
|
rtcpFb?: string[]
|
||||||
}
|
}
|
||||||
|
|
||||||
/* These MUST be the payloads used by the remote as well */
|
/* For optimal performance these payload formats should match the servers one */
|
||||||
const OPUS_VOICE_PAYLOAD_TYPE = 111;
|
const OPUS_VOICE_PAYLOAD_TYPE = 111
|
||||||
const OPUS_MUSIC_PAYLOAD_TYPE = 112;
|
const OPUS_MUSIC_PAYLOAD_TYPE = 112;
|
||||||
const H264_PAYLOAD_TYPE = 126;
|
const H264_PAYLOAD_TYPE = 126;
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ type SdpMedia = {
|
||||||
|
|
||||||
export class SdpProcessor {
|
export class SdpProcessor {
|
||||||
private static readonly kAudioCodecs: SdpCodec[] = [
|
private static readonly kAudioCodecs: SdpCodec[] = [
|
||||||
|
/* Primary audio format */
|
||||||
{
|
{
|
||||||
/* Opus Mono/Opus Voice */
|
/* Opus Mono/Opus Voice */
|
||||||
payload: OPUS_VOICE_PAYLOAD_TYPE,
|
payload: OPUS_VOICE_PAYLOAD_TYPE,
|
||||||
|
@ -45,7 +46,6 @@ export class SdpProcessor {
|
||||||
];
|
];
|
||||||
|
|
||||||
private static readonly kVideoCodecs: SdpCodec[] = [
|
private static readonly kVideoCodecs: SdpCodec[] = [
|
||||||
/* TODO: Set AS as well! */
|
|
||||||
{
|
{
|
||||||
payload: H264_PAYLOAD_TYPE,
|
payload: H264_PAYLOAD_TYPE,
|
||||||
codec: "H264",
|
codec: "H264",
|
||||||
|
@ -186,6 +186,15 @@ export class SdpProcessor {
|
||||||
media.maxptime = media.fmtp["maxptime"];
|
media.maxptime = media.fmtp["maxptime"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(window.detectedBrowser.name === "firefox") {
|
||||||
|
/*
|
||||||
|
* Firefox does not support multiple payload formats not switching between them.
|
||||||
|
* This causes us only to add one, the primary, codec and hope for the best
|
||||||
|
* (Opus Stereo and Mono mixing seem to work right now 11.2020)
|
||||||
|
*/
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
media.payloads = media.rtp.map(e => e.payload).join(" ");
|
media.payloads = media.rtp.map(e => e.payload).join(" ");
|
||||||
|
|
Loading…
Add table
Reference in a new issue