diff --git a/.gitignore b/.gitignore index 39782888..24ef4c64 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,9 @@ vite.config.ts.timestamp-* coverage/ e2eresults.json package-lock.json -src/lib/assets/styles/tailwind-output.css \ No newline at end of file +src/lib/assets/styles/tailwind-output.css +src/lib/stores/adminStore.ts +src/lib/stores/chatStore.ts +src/lib/stores/sfxStore.ts +src/lib/stores/funFactStore.ts +/static/sfx/ \ No newline at end of file diff --git a/package.json b/package.json index 6c6e90bd..2612817e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mage-website", - "version": "0.0.1", + "version": "0.0.2", "license": "GPL-3.0", "private": true, "type": "module", @@ -50,6 +50,7 @@ "vite": "^4.1.4" }, "dependencies": { + "@neodrag/svelte": "^2.0.3", "@tailwindcss/aspect-ratio": "^0.4.2", "@tailwindcss/typography": "^0.5.9", "animate.css": "^4.1.1", diff --git a/src/hooks.server.ts b/src/hooks.server.ts index b38a0ab2..549f4ea0 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -14,7 +14,6 @@ import { user_role } from '$lib/stores/authStore' export const handle: Handle = async ({ event, resolve }) => { const pathname = event.url.pathname - const userId = event.url.searchParams.get('userId') || event.cookies.get('userId') || '' let token = event.url.searchParams.get('token') || event.cookies.get('token') || '' // const lastTimeTillLoadConfig = event.cookies.get('loadConfigTime') || '0' diff --git a/src/lib/WHEPClient.ts b/src/lib/WHEPClient.ts index 722e124d..16f10729 100644 --- a/src/lib/WHEPClient.ts +++ b/src/lib/WHEPClient.ts @@ -9,7 +9,7 @@ export default class WHEPClient { private peerConnection: RTCPeerConnection private stream: MediaStream - constructor(private endpoint: string, private videoElement: HTMLVideoElement) { + constructor(private endpoint: string, private videoElement: any, private trackType: string) { this.stream = new MediaStream() /** @@ -26,14 +26,20 @@ export default class WHEPClient { bundlePolicy: 'max-bundle' }) + const trackOrKind = trackType === 'screen' || trackType === 'webcam' ? 'video' : 'audio' + /** https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/addTransceiver */ - this.peerConnection.addTransceiver('video', { - direction: 'recvonly' - }) - this.peerConnection.addTransceiver('audio', { + this.peerConnection.addTransceiver(trackOrKind, { direction: 'recvonly' }) + //NOTE: used for system audio + if (this.trackType === 'screen') { + this.peerConnection.addTransceiver('audio', { + direction: 'recvonly' + }) + } + /** * When new tracks are received in the connection, store local references, * so that they can be added to a MediaStream, and to the