Adding importance handling
This commit is contained in:
@@ -6,6 +6,8 @@ import {MESSAGE_TYPE_CONSTRAINT} from "./VideoPeer";
|
||||
import type {UserSimplePeerInterface} from "./SimplePeer";
|
||||
import {Readable, readable, writable, Writable} from "svelte/store";
|
||||
import {DivImportance} from "./LayoutManager";
|
||||
import type {ImportanceStore} from "../Stores/ImportanceStore";
|
||||
import {createImportanceStore} from "../Stores/ImportanceStore";
|
||||
|
||||
const Peer: SimplePeerNamespace.SimplePeer = require('simple-peer');
|
||||
|
||||
@@ -22,7 +24,7 @@ export class ScreenSharingPeer extends Peer {
|
||||
public readonly userId: number;
|
||||
public readonly uniqueId: string;
|
||||
public readonly streamStore: Readable<MediaStream | null>;
|
||||
public readonly importanceStore: Writable<DivImportance>;
|
||||
public readonly importanceStore: ImportanceStore;
|
||||
public readonly statusStore: Readable<"connecting" | "connected" | "error" | "closed">;
|
||||
|
||||
constructor(user: UserSimplePeerInterface, initiator: boolean, public readonly userName: string, private connection: RoomConnection, stream: MediaStream | null) {
|
||||
@@ -71,7 +73,7 @@ export class ScreenSharingPeer extends Peer {
|
||||
};
|
||||
});
|
||||
|
||||
this.importanceStore = writable(DivImportance.Important);
|
||||
this.importanceStore = createImportanceStore(DivImportance.Important);
|
||||
|
||||
this.statusStore = readable<"connecting" | "connected" | "error" | "closed">("connecting", (set) => {
|
||||
const onConnect = () => {
|
||||
|
||||
@@ -8,6 +8,8 @@ import type {UserSimplePeerInterface} from "./SimplePeer";
|
||||
import {get, readable, Readable, writable, Writable} from "svelte/store";
|
||||
import {obtainedMediaConstraintStore} from "../Stores/MediaStore";
|
||||
import {DivImportance} from "./LayoutManager";
|
||||
import type {ImportanceStore} from "../Stores/ImportanceStore";
|
||||
import {createImportanceStore} from "../Stores/ImportanceStore";
|
||||
|
||||
const Peer: SimplePeerNamespace.SimplePeer = require('simple-peer');
|
||||
|
||||
@@ -28,7 +30,7 @@ export class VideoPeer extends Peer {
|
||||
private onBlockSubscribe: Subscription;
|
||||
private onUnBlockSubscribe: Subscription;
|
||||
public readonly streamStore: Readable<MediaStream | null>;
|
||||
public readonly importanceStore: Writable<DivImportance>;
|
||||
public readonly importanceStore: ImportanceStore;
|
||||
public readonly statusStore: Readable<"connecting" | "connected" | "error" | "closed">;
|
||||
public readonly constraintsStore: Readable<MediaStreamConstraints|null>;
|
||||
|
||||
@@ -92,7 +94,7 @@ export class VideoPeer extends Peer {
|
||||
};
|
||||
});
|
||||
|
||||
this.importanceStore = writable(DivImportance.Normal);
|
||||
this.importanceStore = createImportanceStore(DivImportance.Normal);
|
||||
|
||||
this.statusStore = readable<"connecting" | "connected" | "error" | "closed">("connecting", (set) => {
|
||||
const onConnect = () => {
|
||||
|
||||
Reference in New Issue
Block a user