|
@@ -6,7 +6,7 @@
|
|
|
</div>
|
|
|
<chat v-show="chatShow" :chatList="chatList" :user_info="user_info"></chat>
|
|
|
|
|
|
- <Trtccom :audioMuted="audioMuted" :videoMuted="videoMuted" v-if="isJoined" />
|
|
|
+ <!-- <Trtccom :audioMuted="audioMuted" :videoMuted="videoMuted" v-if="isJoined" /> -->
|
|
|
|
|
|
<div class="contorlBar" v-if="!showInput">
|
|
|
<div v-if="connectStatus == 1" :class="{ disabled: !user_info.IsWords }" class="saySomething" @click="onFocus">
|
|
@@ -96,7 +96,7 @@ import common from "@/utils/common";
|
|
|
|
|
|
import { mapGetters } from "vuex";
|
|
|
import chat from "./chat/chat.vue";
|
|
|
-import Trtccom from "./Trtccom.vue";
|
|
|
+// import Trtccom from "./Trtccom.vue";
|
|
|
import browser from "@/utils/browser";
|
|
|
|
|
|
const emit = defineEmits(["openDialog"]);
|
|
@@ -134,6 +134,13 @@ let getUrl = (href, queryArr) => {
|
|
|
};
|
|
|
const videoDeviceId = computed(() => store.getters["rtc/videoDeviceId"]);
|
|
|
|
|
|
+window.addEventListener("message", (e) => {
|
|
|
+ if (e.data.source != "cdf") {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ store.commit("rtc/setVideoDeviceId", e.data.params.videoDeviceId);
|
|
|
+});
|
|
|
+
|
|
|
const connectStatus = ref(0);
|
|
|
const isBrushes = ref(false);
|
|
|
const showInput = ref(false);
|
|
@@ -142,6 +149,33 @@ const animateActive = ref(false);
|
|
|
|
|
|
const audioMuted = ref(false);
|
|
|
const videoMuted = ref(false);
|
|
|
+const isJoined = ref(false);
|
|
|
+
|
|
|
+watch(audioMuted, () => {
|
|
|
+ window.parent.postMessage(
|
|
|
+ {
|
|
|
+ source: "cdf",
|
|
|
+ event: "audioMuted",
|
|
|
+ params: {
|
|
|
+ audioMuted: audioMuted.value,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ "*"
|
|
|
+ );
|
|
|
+});
|
|
|
+
|
|
|
+watch(videoMuted, () => {
|
|
|
+ window.parent.postMessage(
|
|
|
+ {
|
|
|
+ source: "cdf",
|
|
|
+ event: "videoMuted",
|
|
|
+ params: {
|
|
|
+ videoMuted: videoMuted.value,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ "*"
|
|
|
+ );
|
|
|
+});
|
|
|
|
|
|
const socket = computed(() => store.getters["rtc/socket"]);
|
|
|
|
|
@@ -155,8 +189,6 @@ const role = ref(browser.getURLParam("role"));
|
|
|
const userId = computed(() => store.getters["rtc/userId"]);
|
|
|
const roomId = computed(() => store.getters["rtc/roomId"]);
|
|
|
|
|
|
-const isJoined = ref(false);
|
|
|
-
|
|
|
const paint = reactive({});
|
|
|
|
|
|
const chatList = ref([]);
|
|
@@ -276,8 +308,6 @@ const onDrawUndo = async () => {
|
|
|
let app = await getApp();
|
|
|
app.Connect.paint.undo();
|
|
|
canUndo.value = app.Connect.paint.records.length > 0;
|
|
|
-
|
|
|
- console.log(app.Connect.paint.records, "app.Connect.paint.records");
|
|
|
};
|
|
|
|
|
|
// 畫筆開啟
|
|
@@ -440,6 +470,17 @@ const startFollow = (app) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ window.parent.postMessage(
|
|
|
+ {
|
|
|
+ source: "cdf",
|
|
|
+ event: "isJoined",
|
|
|
+ params: {
|
|
|
+ isJoined: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ "*"
|
|
|
+ );
|
|
|
+
|
|
|
isJoined.value = true;
|
|
|
|
|
|
user_info.value = data.user;
|
|
@@ -451,7 +492,7 @@ const startFollow = (app) => {
|
|
|
}, []);
|
|
|
|
|
|
//更新分享鏈接
|
|
|
- shareLink.value = getUrl(window.location.href, [
|
|
|
+ shareLink.value = getUrl(window.location.href.replace('scene.html','index.html'), [
|
|
|
{
|
|
|
key: "mode",
|
|
|
val: mode.value,
|
|
@@ -497,6 +538,16 @@ const startFollow = (app) => {
|
|
|
}
|
|
|
|
|
|
history.replaceState(null, null, tmp);
|
|
|
+ window.parent.postMessage(
|
|
|
+ {
|
|
|
+ source: "cdf",
|
|
|
+ event: "urlReplace",
|
|
|
+ params: {
|
|
|
+ tempUrl: tmp,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ "*"
|
|
|
+ );
|
|
|
});
|
|
|
|
|
|
socket.value.on("action", (data) => {
|