Fixed the TeaWeb client for safari
parent
64a28ffa4c
commit
fbcfceb32b
|
@ -541,6 +541,8 @@ export class RTCConnection {
|
|||
this.reset(true);
|
||||
|
||||
this.connection.events.on("notify_connection_state_changed", event => this.handleConnectionStateChanged(event));
|
||||
|
||||
(window as any).rtp = this;
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
|
|
@ -248,9 +248,9 @@ export class WebVideoSource implements VideoSource {
|
|||
private readonly deviceId: string;
|
||||
private readonly displayName: string;
|
||||
private readonly stream: MediaStream;
|
||||
private readonly initialSettings: VideoSourceInitialSettings;
|
||||
private referenceCount = 1;
|
||||
|
||||
private initialSettings: VideoSourceInitialSettings;
|
||||
|
||||
constructor(deviceId: string, displayName: string, stream: MediaStream) {
|
||||
this.deviceId = deviceId;
|
||||
|
@ -291,13 +291,13 @@ export class WebVideoSource implements VideoSource {
|
|||
|
||||
return {
|
||||
minWidth: capabilities?.width?.min || 1,
|
||||
maxWidth: capabilities?.width?.max || this.initialSettings.width,
|
||||
maxWidth: capabilities?.width?.max || this.initialSettings.width || undefined,
|
||||
|
||||
minHeight: capabilities?.height?.min || 1,
|
||||
maxHeight: capabilities?.height?.max || this.initialSettings.height,
|
||||
maxHeight: capabilities?.height?.max || this.initialSettings.height || undefined,
|
||||
|
||||
minFrameRate: capabilities?.frameRate?.min || 1,
|
||||
maxFrameRate: capabilities?.frameRate?.max || this.initialSettings.frameRate
|
||||
maxFrameRate: capabilities?.frameRate?.max || this.initialSettings.frameRate || undefined
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -644,6 +644,20 @@ export class Settings {
|
|||
valueType: "number",
|
||||
};
|
||||
|
||||
static readonly KEY_VIDEO_DEFAULT_MAX_BANDWIDTH: ValuedRegistryKey<number> = {
|
||||
key: "video_default_max_bandwidth",
|
||||
defaultValue: 1_600_000,
|
||||
description: "The default video bandwidth to use in bits/seconds.\nA too high value might not be allowed by all server permissions.",
|
||||
valueType: "number",
|
||||
};
|
||||
|
||||
static readonly KEY_VIDEO_DEFAULT_KEYFRAME_INTERVAL: ValuedRegistryKey<number> = {
|
||||
key: "video_default_keyframe_interval",
|
||||
defaultValue: 0,
|
||||
description: "The default interval to forcibly request a keyframe from ourself in seconds. A value of zero means no such interval.",
|
||||
valueType: "number",
|
||||
};
|
||||
|
||||
static readonly KEY_VIDEO_DYNAMIC_QUALITY: ValuedRegistryKey<boolean> = {
|
||||
key: "video_dynamic_quality",
|
||||
defaultValue: true,
|
||||
|
|
|
@ -128,13 +128,20 @@ async function generateAndApplyDefaultConfig(source: VideoSource) : Promise<Vide
|
|||
const trackSettings = videoTrack.getSettings();
|
||||
const capabilities = source.getCapabilities();
|
||||
|
||||
maxHeight = Math.min(maxHeight, capabilities.maxHeight);
|
||||
maxWidth = Math.min(maxWidth, capabilities.maxWidth);
|
||||
/* Safari */
|
||||
if(trackSettings.height === 0) {
|
||||
trackSettings.height = capabilities.maxHeight;
|
||||
}
|
||||
if(trackSettings.width === 0) {
|
||||
trackSettings.width = capabilities.maxWidth;
|
||||
}
|
||||
|
||||
maxHeight = maxHeight ? Math.min(maxHeight, capabilities.maxHeight) : capabilities.maxHeight;
|
||||
maxWidth = maxWidth ? Math.min(maxWidth, capabilities.maxWidth) : capabilities.maxWidth;
|
||||
|
||||
/* FIXME: Get these values somewhere else! */
|
||||
const broadcastConstraints: VideoBroadcastConfig = {
|
||||
maxBandwidth: 1_600_000,
|
||||
keyframeInterval: 0
|
||||
maxBandwidth: settings.getValue(Settings.KEY_VIDEO_DEFAULT_MAX_BANDWIDTH),
|
||||
keyframeInterval: settings.getValue(Settings.KEY_VIDEO_DEFAULT_KEYFRAME_INTERVAL)
|
||||
} as VideoBroadcastConfig;
|
||||
|
||||
{
|
||||
|
@ -163,7 +170,7 @@ async function generateAndApplyDefaultConfig(source: VideoSource) : Promise<Vide
|
|||
try {
|
||||
await applyBroadcastConfig(source, broadcastConstraints);
|
||||
} catch (error) {
|
||||
logWarn(LogCategory.VIDEO, tr("Failed to apply initial default broadcast config: %o"), error);
|
||||
logWarn(LogCategory.VIDEO, tr("Failed to apply initial default broadcast config (%o): %o"), broadcastConstraints, error);
|
||||
}
|
||||
|
||||
updateBroadcastConfigFromSource(source, broadcastConstraints);
|
||||
|
|
|
@ -13,8 +13,8 @@ export interface VideoSourceCapabilities {
|
|||
}
|
||||
|
||||
export interface VideoSourceInitialSettings {
|
||||
width: number,
|
||||
height: number,
|
||||
width: number | 0,
|
||||
height: number | 0,
|
||||
frameRate: number
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue