allow to use custom applications
This commit is contained in:
@@ -8,7 +8,9 @@
|
|||||||
import { createMatrixRTCSdk } from "http://localhost:8123/matrixrtc-sdk.js";
|
import { createMatrixRTCSdk } from "http://localhost:8123/matrixrtc-sdk.js";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
window.matrixRTCSdk = await createMatrixRTCSdk();
|
window.matrixRTCSdk = await createMatrixRTCSdk(
|
||||||
|
"com.github.toger5.godot-game",
|
||||||
|
);
|
||||||
console.info("createMatrixRTCSdk was created!");
|
console.info("createMatrixRTCSdk was created!");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("createMatrixRTCSdk", e);
|
console.error("createMatrixRTCSdk", e);
|
||||||
|
|||||||
12
sdk/main.ts
12
sdk/main.ts
@@ -30,7 +30,9 @@ import {
|
|||||||
} from "rxjs";
|
} from "rxjs";
|
||||||
import {
|
import {
|
||||||
type CallMembership,
|
type CallMembership,
|
||||||
|
MatrixRTCSession,
|
||||||
MatrixRTCSessionEvent,
|
MatrixRTCSessionEvent,
|
||||||
|
SlotDescription,
|
||||||
} from "matrix-js-sdk/lib/matrixrtc";
|
} from "matrix-js-sdk/lib/matrixrtc";
|
||||||
import {
|
import {
|
||||||
type Room as LivekitRoom,
|
type Room as LivekitRoom,
|
||||||
@@ -80,7 +82,10 @@ interface MatrixRTCSdk {
|
|||||||
sendData?: (data: unknown) => Promise<void>;
|
sendData?: (data: unknown) => Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function createMatrixRTCSdk(): Promise<MatrixRTCSdk> {
|
export async function createMatrixRTCSdk(
|
||||||
|
application: string = "m.call",
|
||||||
|
id: string = "",
|
||||||
|
): Promise<MatrixRTCSdk> {
|
||||||
logger.info("Hello");
|
logger.info("Hello");
|
||||||
const client = await widget.client;
|
const client = await widget.client;
|
||||||
logger.info("client created");
|
logger.info("client created");
|
||||||
@@ -93,7 +98,10 @@ export async function createMatrixRTCSdk(): Promise<MatrixRTCSdk> {
|
|||||||
|
|
||||||
const mediaDevices = new MediaDevices(scope);
|
const mediaDevices = new MediaDevices(scope);
|
||||||
const muteStates = new MuteStates(scope, mediaDevices, constant(true));
|
const muteStates = new MuteStates(scope, mediaDevices, constant(true));
|
||||||
const rtcSession = client.matrixRTC.getRoomSession(room);
|
const rtcSession = new MatrixRTCSession(client, room, {
|
||||||
|
application,
|
||||||
|
id,
|
||||||
|
});
|
||||||
const callViewModel = createCallViewModel$(
|
const callViewModel = createCallViewModel$(
|
||||||
scope,
|
scope,
|
||||||
rtcSession,
|
rtcSession,
|
||||||
|
|||||||
Reference in New Issue
Block a user