Skip to content

Commit

Permalink
Fix cam overlay breaking with custom vdo links
Browse files Browse the repository at this point in the history
  • Loading branch information
slmnio committed Aug 25, 2023
1 parent 1c948b7 commit d71a5b7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions website/src/components/broadcast/desk/CasterCam.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ export default {
if (this.relayPrefix) return this.relayPrefix;
return this.guest?.cam_code || "";
},
streamCode() {
if (this.streamID.includes("view=")) {
const url = new URL(this.streamID);
return url.searchParams.get("view");
}
return this.streamID;
},
src() {
const vdoDomain = "https://cams.prod.slmn.gg";
if (this.streamID.includes("http")) {
Expand Down Expand Up @@ -96,14 +103,16 @@ export default {
console.log("[global iframe]", e.data);
const data = e.data;
if (data.action === "new-track-added" && data.streamID === this.streamID) {
console.log("stream ID", this.streamCode, data.streamID);
if (data.action === "new-track-added" && data.streamID === this.streamCode) {
setTimeout(() => {
this.apiVisible = true;
this.extendedIframeVisible = true;
}, 400);
console.log("track added, loaded");
}
if (data.action === "end-view-connection" && data.value === this.streamID) {
if (data.action === "end-view-connection" && data.value === this.streamCode) {
this.slowDisableCam(); // we need it to stay open if they reconnect
console.log("view dc, unloaded");
}
Expand Down

0 comments on commit d71a5b7

Please sign in to comment.