1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
| <template>
| <div class="meet-container w-screen h-screen">
| <div id="meet" ref="meet"></div>
| </div>
| </template>
|
| <script setup>
| import {ref, watch, onMounted} from 'vue';
| import {useRoute} from 'vue-router';
| import useWebScoket from "@/hooks/useWebScoket.js";
| import {storeToRefs} from 'pinia';
| import {useUserStore} from '@/store/index.js';
|
| const route = useRoute();
| const meet = ref(null);
|
| const userStore = useUserStore();
| const {userInfo} = storeToRefs(userStore);
| const {meetName, id, userName, userCode} = route.query;
| let jitsiApi = null;
| onMounted(() => {
| const width = window.innerWidth;
| const height = window.innerHeight;
| const domain = 'ycl.easyblog.vip:8443/' + id;
| const options = {
| roomName: meetName,
| width: width,
| height: height,
| parentNode: meet.value,
| lang: 'zh_CN',
| configOverwrite: {
| prejoinConfig: {
| enabled: false
| },
| //禁用邮箱
| gravatar: {
| disabled: true
| },
| // 控制顶部标题会议信息标签的可见性和行为。
| // 如果标签的 ID 不在上述两个数组中的任何一个中,则它在标题上根本不可见。
| conferenceInfo: {
| // 这些标签不会与工具箱一起隐藏。
| alwaysVisible: ['recording'],
| // 这些标签将与工具箱按钮一起自动隐藏。
| autoHide: [
| // 'raised-hands-count',
| 'subject',
| 'conference-timer',
| 'participants-count',
| 'e2ee',
| 'video-quality',
| 'insecure-room',
| 'highlight-moment',
| 'top-panel-toggle',
| ]
| },
| ModeratorIndicator: true,
| startSilent: true,
| //禁用改名
| readOnlyName: true,
| //参会者名单
| remoteVideoMenu: {
| disabled: false,
| disableKick: true,
| disableGrantModerator: true,
| disabledDemote: false
| },
| // 自定义按钮
| toolbarButtons: [
| // 摄像头
| 'camera',
| // 聊天
| 'chat',
| // 共享
| 'desktop',
| 'download',
| 'fullscreen',
| 'hangup',
| 'highlight',
| 'linktosalesforce',
| 'livestreaming',
| 'microphone',
| 'noisesuppression',
| 'raisehand',
| 'recording',
| 'select-background',
| 'settings',
| 'shareaudio',
| 'sharedvideo',
| 'shortcuts',
| 'stats',
| 'tileview',
| 'toggle-camera',
| // 'closedcaptions',
| // 'embedmeeting',
| // 'etherpad',
| // 'feedback',
| // 'filmstrip',
| // 'help',
| // 'invite',
| // 'participants-pane',
| // 'profile',
| // 'security',
| 'videoquality',
| 'whiteboard'
| ],
| // 禁用邀请
| disableInviteFunctions: true,
| //禁用全部静音
| disableRemoteMute: true,
| //主持人选项
| participantsPane: {
| enabled: false,
| hideMoreActionsButton: true,
| hideModeratorSettingsTab: true,
| hideMuteAllButton: true,
| },
| //取消退出页面
| enableClosePage: false,
| whiteboard: {
| enabled: true
| }
| },
|
| userInfo: {
| displayName: userName
| }
| };
| jitsiApi = new JitsiMeetExternalAPI(domain, options);
| jitsiInit();
|
| // 连接webscoket
| connect();
| });
|
| const jitsiInit = () => {
| jitsiApi.addListener('readyToClose', () => {
| window.close()
| });
| }
|
| const {status, message, error, connect, disconnect, sendMessage} = useWebScoket({
| url: 'ws://127.0.0.1:8000/websocket/' + userInfo._rawValue.id,
| heartBeatData: 'ping'
| });
|
| watch(
| () => message.value,
| (msg) => {
| console.log('msg', msg.commend);
| if (msg.commend === 'kickOut') {
| jitsiApi.executeCommand('hangup');
| }
| if (msg.commend === 'mute') {
| jitsiApi.executeCommand('toggleAudio');
| }
| if (msg.commend === 'openCamera') {
| jitsiApi.executeCommand('toggleVideo');
| }
| }
| );
|
|
| </script>
|
| <style lang="scss" scoped></style>
|
|