mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-05 19:59:20 +00:00
@@ -6,6 +6,9 @@ Please see LICENSE in the repository root for full details.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { BehaviorSubject, Subject } from "rxjs";
|
import { BehaviorSubject, Subject } from "rxjs";
|
||||||
|
import { logger as rootLogger } from "matrix-js-sdk/lib/logger";
|
||||||
|
|
||||||
|
const logger = rootLogger.getChild("[controlled-media]");
|
||||||
|
|
||||||
export interface Controls {
|
export interface Controls {
|
||||||
canEnterPip(): boolean;
|
canEnterPip(): boolean;
|
||||||
@@ -79,12 +82,17 @@ window.controls = {
|
|||||||
setPipEnabled$.next(false);
|
setPipEnabled$.next(false);
|
||||||
},
|
},
|
||||||
setAvailableAudioDevices(devices: OutputDevice[]): void {
|
setAvailableAudioDevices(devices: OutputDevice[]): void {
|
||||||
|
logger.info("setAvailableAudioDevices called from native:", devices);
|
||||||
|
|
||||||
controlledAvailableOutputDevices$.next(devices);
|
controlledAvailableOutputDevices$.next(devices);
|
||||||
},
|
},
|
||||||
setAudioDevice(id: string): void {
|
setAudioDevice(id: string): void {
|
||||||
|
logger.info("setAudioDevice called from native", id);
|
||||||
controlledAudioDevice$.next(id);
|
controlledAudioDevice$.next(id);
|
||||||
},
|
},
|
||||||
setAudioEnabled(enabled: boolean): void {
|
setAudioEnabled(enabled: boolean): void {
|
||||||
|
logger.info("setAudioEnabled called from native:", enabled);
|
||||||
|
|
||||||
if (!setAudioEnabled$.observed)
|
if (!setAudioEnabled$.observed)
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"Output controls are disabled. No setAudioEnabled$ observer",
|
"Output controls are disabled. No setAudioEnabled$ observer",
|
||||||
|
|||||||
@@ -385,6 +385,10 @@ function useControlledOutput(): MediaDeviceHandle {
|
|||||||
// selected - for example, Element X iOS listens to this to determine whether it
|
// selected - for example, Element X iOS listens to this to determine whether it
|
||||||
// should enable the proximity sensor.
|
// should enable the proximity sensor.
|
||||||
if (preferredId) {
|
if (preferredId) {
|
||||||
|
logger.info(
|
||||||
|
"[controlled-media] setAudioDeviceSelect called:",
|
||||||
|
preferredId,
|
||||||
|
);
|
||||||
window.controls.onAudioDeviceSelect?.(preferredId);
|
window.controls.onAudioDeviceSelect?.(preferredId);
|
||||||
// Call deprecated method for backwards compatibility.
|
// Call deprecated method for backwards compatibility.
|
||||||
window.controls.onOutputDeviceSelect?.(preferredId);
|
window.controls.onOutputDeviceSelect?.(preferredId);
|
||||||
|
|||||||
@@ -73,8 +73,6 @@ export function useLivekit(
|
|||||||
|
|
||||||
// Only ever create the room once via useInitial.
|
// Only ever create the room once via useInitial.
|
||||||
const room = useInitial(() => {
|
const room = useInitial(() => {
|
||||||
logger.info("[LivekitRoom] Create LiveKit room");
|
|
||||||
|
|
||||||
let e2ee: E2EEManagerOptions | undefined;
|
let e2ee: E2EEManagerOptions | undefined;
|
||||||
if (e2eeSystem.kind === E2eeType.PER_PARTICIPANT) {
|
if (e2eeSystem.kind === E2eeType.PER_PARTICIPANT) {
|
||||||
logger.info("Created MatrixKeyProvider (per participant)");
|
logger.info("Created MatrixKeyProvider (per participant)");
|
||||||
@@ -110,6 +108,7 @@ export function useLivekit(
|
|||||||
},
|
},
|
||||||
e2ee,
|
e2ee,
|
||||||
};
|
};
|
||||||
|
logger.info("[LivekitRoom] Create LiveKit room with options", roomOptions);
|
||||||
// We have to create the room manually here due to a bug inside
|
// We have to create the room manually here due to a bug inside
|
||||||
// @livekit/components-react. JSON.stringify() is used in deps of a
|
// @livekit/components-react. JSON.stringify() is used in deps of a
|
||||||
// useEffect() with an argument that references itself, if E2EE is enabled
|
// useEffect() with an argument that references itself, if E2EE is enabled
|
||||||
|
|||||||
Reference in New Issue
Block a user