mdm-client 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/README.md +92 -0
  2. package/index.js +35 -0
  3. package/package.json +41 -0
  4. package/src/App.vue +246 -0
  5. package/src/assets/audio/moon_light.ogg +0 -0
  6. package/src/assets/font/DINPro-Medium.otf +0 -0
  7. package/src/assets/font/FZZhengHeiS-B-GB.ttf +0 -0
  8. package/src/assets/font/PingFang Regular.otf +0 -0
  9. package/src/assets/font/SourceHanSansCN-Regular.otf +0 -0
  10. package/src/assets/image/common/add_other_icon.png +0 -0
  11. package/src/assets/image/common/bottomFrame.png +0 -0
  12. package/src/assets/image/common/broadcastOn.png +0 -0
  13. package/src/assets/image/common/broadcastTask.png +0 -0
  14. package/src/assets/image/common/call.png +0 -0
  15. package/src/assets/image/common/call_user_mic_off_icon.png +0 -0
  16. package/src/assets/image/common/call_user_mic_on_icon.png +0 -0
  17. package/src/assets/image/common/cam-off.png +0 -0
  18. package/src/assets/image/common/cam-on.png +0 -0
  19. package/src/assets/image/common/cam_off_small.png +0 -0
  20. package/src/assets/image/common/camera.png +0 -0
  21. package/src/assets/image/common/cameraBtn1.png +0 -0
  22. package/src/assets/image/common/cameraBtn2.png +0 -0
  23. package/src/assets/image/common/cameraBtn3.png +0 -0
  24. package/src/assets/image/common/cameraBtn4.png +0 -0
  25. package/src/assets/image/common/cameraBtn5.png +0 -0
  26. package/src/assets/image/common/cameraBtn6.png +0 -0
  27. package/src/assets/image/common/cameraBtn7.png +0 -0
  28. package/src/assets/image/common/cameraClose.png +0 -0
  29. package/src/assets/image/common/cameraFull.png +0 -0
  30. package/src/assets/image/common/cameraOff.png +0 -0
  31. package/src/assets/image/common/cancel_icon.png +0 -0
  32. package/src/assets/image/common/card_blue.png +0 -0
  33. package/src/assets/image/common/card_grey.png +0 -0
  34. package/src/assets/image/common/chosen_icon.png +0 -0
  35. package/src/assets/image/common/chosen_icon_slided.png +0 -0
  36. package/src/assets/image/common/custom_layout_equipment_avatar.png +0 -0
  37. package/src/assets/image/common/custom_layout_user_avatar.png +0 -0
  38. package/src/assets/image/common/default_avatar.png +0 -0
  39. package/src/assets/image/common/default_avatar_mini.png +0 -0
  40. package/src/assets/image/common/delete-number.svg +3 -0
  41. package/src/assets/image/common/deviceIcon.png +0 -0
  42. package/src/assets/image/common/fourOff.png +0 -0
  43. package/src/assets/image/common/fourOn.png +0 -0
  44. package/src/assets/image/common/group.png +0 -0
  45. package/src/assets/image/common/groupManage.png +0 -0
  46. package/src/assets/image/common/histroy_meeting_icon.png +0 -0
  47. package/src/assets/image/common/icon-device.svg +12 -0
  48. package/src/assets/image/common/icon-monitor.svg +12 -0
  49. package/src/assets/image/common/icon-/345/260/217/347/250/213/345/272/217.svg +5 -0
  50. package/src/assets/image/common/icon-/345/272/224/347/255/224.svg +5 -0
  51. package/src/assets/image/common/icon-/350/247/206/351/242/221.svg +7 -0
  52. package/src/assets/image/common/input_search_icon.png +0 -0
  53. package/src/assets/image/common/launch_icon.png +0 -0
  54. package/src/assets/image/common/layout-active1.png +0 -0
  55. package/src/assets/image/common/layout-active2.png +0 -0
  56. package/src/assets/image/common/layout1.png +0 -0
  57. package/src/assets/image/common/layout2.png +0 -0
  58. package/src/assets/image/common/loading.png +0 -0
  59. package/src/assets/image/common/login/checked_icon.png +0 -0
  60. package/src/assets/image/common/login/login_bg.png +0 -0
  61. package/src/assets/image/common/login/login_form_left_icon.png +0 -0
  62. package/src/assets/image/common/login/pwd_icon.png +0 -0
  63. package/src/assets/image/common/login/user_icon.png +0 -0
  64. package/src/assets/image/common/login/verify_icon.png +0 -0
  65. package/src/assets/image/common/logo.png +0 -0
  66. package/src/assets/image/common/ltypeOff.png +0 -0
  67. package/src/assets/image/common/ltypeOn.png +0 -0
  68. package/src/assets/image/common/manager_cam_off_icon.png +0 -0
  69. package/src/assets/image/common/manager_mic_off_icon.png +0 -0
  70. package/src/assets/image/common/map-cicle-icon.svg +6 -0
  71. package/src/assets/image/common/map-icon-search-info.svg +11 -0
  72. package/src/assets/image/common/map-location.svg +37 -0
  73. package/src/assets/image/common/map.png +0 -0
  74. package/src/assets/image/common/mic-off.png +0 -0
  75. package/src/assets/image/common/mic-on.png +0 -0
  76. package/src/assets/image/common/mic_off_small.png +0 -0
  77. package/src/assets/image/common/minum_cam_off_icon.png +0 -0
  78. package/src/assets/image/common/minum_cam_on_icon.png +0 -0
  79. package/src/assets/image/common/minum_expand_icon.png +0 -0
  80. package/src/assets/image/common/minum_mic_off_icon.png +0 -0
  81. package/src/assets/image/common/minum_mic_on_icon.png +0 -0
  82. package/src/assets/image/common/minum_reset_icon.png +0 -0
  83. package/src/assets/image/common/minum_slide_icon.png +0 -0
  84. package/src/assets/image/common/more_icon.png +0 -0
  85. package/src/assets/image/common/mute.png +0 -0
  86. package/src/assets/image/common/newFolder.png +0 -0
  87. package/src/assets/image/common/newTask.png +0 -0
  88. package/src/assets/image/common/nineOff.png +0 -0
  89. package/src/assets/image/common/nineOn.png +0 -0
  90. package/src/assets/image/common/none.png +0 -0
  91. package/src/assets/image/common/offline.png +0 -0
  92. package/src/assets/image/common/oneOff.png +0 -0
  93. package/src/assets/image/common/oneOn.png +0 -0
  94. package/src/assets/image/common/online.png +0 -0
  95. package/src/assets/image/common/output_off_small.png +0 -0
  96. package/src/assets/image/common/playOff.png +0 -0
  97. package/src/assets/image/common/playOn.png +0 -0
  98. package/src/assets/image/common/playStop.png +0 -0
  99. package/src/assets/image/common/preview_icon.png +0 -0
  100. package/src/assets/image/common/preview_meet_icon.png +0 -0
  101. package/src/assets/image/common/scan-map.png +0 -0
  102. package/src/assets/image/common/screen_blue.png +0 -0
  103. package/src/assets/image/common/screen_gray.png +0 -0
  104. package/src/assets/image/common/screen_white.png +0 -0
  105. package/src/assets/image/common/select_item_check.png +0 -0
  106. package/src/assets/image/common/select_item_checked.png +0 -0
  107. package/src/assets/image/common/selector.png +0 -0
  108. package/src/assets/image/common/selectorOn.png +0 -0
  109. package/src/assets/image/common/share_icon.png +0 -0
  110. package/src/assets/image/common/signal_good.png +0 -0
  111. package/src/assets/image/common/signal_poor.png +0 -0
  112. package/src/assets/image/common/sixteenOff.png +0 -0
  113. package/src/assets/image/common/sixteenOn.png +0 -0
  114. package/src/assets/image/common/slide-bth-expand.png +0 -0
  115. package/src/assets/image/common/slide_btn.png +0 -0
  116. package/src/assets/image/common/speak.png +0 -0
  117. package/src/assets/image/common/speakOn.png +0 -0
  118. package/src/assets/image/common/speaker-off.png +0 -0
  119. package/src/assets/image/common/speaker-on.png +0 -0
  120. package/src/assets/image/common/speaking.png +0 -0
  121. package/src/assets/image/common/speed-left.svg +5 -0
  122. package/src/assets/image/common/speed-right.svg +5 -0
  123. package/src/assets/image/common/tree_checked_icon.png +0 -0
  124. package/src/assets/image/common/tree_expand_icon.png +0 -0
  125. package/src/assets/image/common/tree_slide_icon.png +0 -0
  126. package/src/assets/image/common/tree_uncheck_icon.png +0 -0
  127. package/src/assets/image/common/unchosen_icon.png +0 -0
  128. package/src/assets/image/common/up.png +0 -0
  129. package/src/assets/image/common/volume.png +0 -0
  130. package/src/assets/image/common/warning.png +0 -0
  131. package/src/assets/image/screenBlue/a1.png +0 -0
  132. package/src/assets/image/screenBlue/a2.png +0 -0
  133. package/src/assets/image/screenBlue/a3.png +0 -0
  134. package/src/assets/image/screenBlue/a4.png +0 -0
  135. package/src/assets/image/screenBlue/a5.png +0 -0
  136. package/src/assets/image/screenBlue/a6.png +0 -0
  137. package/src/assets/image/screenBlue/add.png +0 -0
  138. package/src/assets/image/screenBlue/add_group_icon.png +0 -0
  139. package/src/assets/image/screenBlue/add_to_group_icon.png +0 -0
  140. package/src/assets/image/screenBlue/arrow_icon.png +0 -0
  141. package/src/assets/image/screenBlue/audio_level_icon.png +0 -0
  142. package/src/assets/image/screenBlue/b1.png +0 -0
  143. package/src/assets/image/screenBlue/b2.png +0 -0
  144. package/src/assets/image/screenBlue/b3.png +0 -0
  145. package/src/assets/image/screenBlue/b4.png +0 -0
  146. package/src/assets/image/screenBlue/b5.png +0 -0
  147. package/src/assets/image/screenBlue/b6.png +0 -0
  148. package/src/assets/image/screenBlue/bottom_footer_bg.png +0 -0
  149. package/src/assets/image/screenBlue/call_clear_icon.png +0 -0
  150. package/src/assets/image/screenBlue/call_duration_icon.png +0 -0
  151. package/src/assets/image/screenBlue/call_fullscreen_icon.png +0 -0
  152. package/src/assets/image/screenBlue/call_mini_icon.png +0 -0
  153. package/src/assets/image/screenBlue/call_video_icon.png +0 -0
  154. package/src/assets/image/screenBlue/call_voice_icon.png +0 -0
  155. package/src/assets/image/screenBlue/cam_on_small.png +0 -0
  156. package/src/assets/image/screenBlue/close_icon.png +0 -0
  157. package/src/assets/image/screenBlue/copy-icon.png +0 -0
  158. package/src/assets/image/screenBlue/custom_layout_drag_icon.png +0 -0
  159. package/src/assets/image/screenBlue/custom_layout_grid16_active_icon.png +0 -0
  160. package/src/assets/image/screenBlue/custom_layout_grid16_icon.png +0 -0
  161. package/src/assets/image/screenBlue/custom_layout_grid4_active_icon.png +0 -0
  162. package/src/assets/image/screenBlue/custom_layout_grid4_icon.png +0 -0
  163. package/src/assets/image/screenBlue/custom_layout_grid9_active_icon.png +0 -0
  164. package/src/assets/image/screenBlue/custom_layout_grid9_icon.png +0 -0
  165. package/src/assets/image/screenBlue/custom_layout_header_icon.png +0 -0
  166. package/src/assets/image/screenBlue/custom_layout_placeholder_bg.png +0 -0
  167. package/src/assets/image/screenBlue/custom_layout_refresh_icon.png +0 -0
  168. package/src/assets/image/screenBlue/custom_layout_rightside_active_icon.png +0 -0
  169. package/src/assets/image/screenBlue/custom_layout_rightside_icon.png +0 -0
  170. package/src/assets/image/screenBlue/custom_layout_ring_active_icon.png +0 -0
  171. package/src/assets/image/screenBlue/custom_layout_ring_icon.png +0 -0
  172. package/src/assets/image/screenBlue/custom_layout_topside_active_icon.png +0 -0
  173. package/src/assets/image/screenBlue/custom_layout_topside_icon.png +0 -0
  174. package/src/assets/image/screenBlue/date_picker_icon.png +0 -0
  175. package/src/assets/image/screenBlue/dialog_check_icon.png +0 -0
  176. package/src/assets/image/screenBlue/emoji-logo.png +0 -0
  177. package/src/assets/image/screenBlue/header_alert_icon.png +0 -0
  178. package/src/assets/image/screenBlue/manager_cam_on_icon.png +0 -0
  179. package/src/assets/image/screenBlue/manager_mic_on_icon.png +0 -0
  180. package/src/assets/image/screenBlue/manager_more_icon.png +0 -0
  181. package/src/assets/image/screenBlue/meeting_board_bg.png +0 -0
  182. package/src/assets/image/screenBlue/meeting_chat_emoji_icon.png +0 -0
  183. package/src/assets/image/screenBlue/meeting_chat_icon.png +0 -0
  184. package/src/assets/image/screenBlue/meeting_chat_image_icon.png +0 -0
  185. package/src/assets/image/screenBlue/meeting_chat_logo.png +0 -0
  186. package/src/assets/image/screenBlue/meeting_copy_icon.png +0 -0
  187. package/src/assets/image/screenBlue/meeting_invite_icon.png +0 -0
  188. package/src/assets/image/screenBlue/meeting_layout_icon.png +0 -0
  189. package/src/assets/image/screenBlue/meeting_member_icon.png +0 -0
  190. package/src/assets/image/screenBlue/meeting_mode_icon.png +0 -0
  191. package/src/assets/image/screenBlue/meeting_record_icon.png +0 -0
  192. package/src/assets/image/screenBlue/meeting_setting_icon.png +0 -0
  193. package/src/assets/image/screenBlue/meeting_share_icon.png +0 -0
  194. package/src/assets/image/screenBlue/meeting_slide_small_icon.png +0 -0
  195. package/src/assets/image/screenBlue/mic_on_small.png +0 -0
  196. package/src/assets/image/screenBlue/module_bg1.png +0 -0
  197. package/src/assets/image/screenBlue/module_bg2.png +0 -0
  198. package/src/assets/image/screenBlue/monitor/circle data.png +0 -0
  199. package/src/assets/image/screenBlue/monitor/circle.png +0 -0
  200. package/src/assets/image/screenBlue/output_on_small.png +0 -0
  201. package/src/assets/image/screenBlue/page_bg.png +0 -0
  202. package/src/assets/image/screenBlue/pic-logo.png +0 -0
  203. package/src/assets/image/screenBlue/preview_date_icon.png +0 -0
  204. package/src/assets/image/screenBlue/preview_empty_icon.png +0 -0
  205. package/src/assets/image/screenBlue/preview_more_icon.png +0 -0
  206. package/src/assets/image/screenBlue/receive_hang_off_icon.png +0 -0
  207. package/src/assets/image/screenBlue/receive_hang_on_icon.png +0 -0
  208. package/src/assets/image/screenBlue/receive_video_icon.png +0 -0
  209. package/src/assets/image/screenBlue/receive_voice_icon.png +0 -0
  210. package/src/assets/image/screenBlue/send-logo.png +0 -0
  211. package/src/assets/image/screenBlue/slide_menu_bg.png +0 -0
  212. package/src/assets/image/screenBlue/top_header_bg.png +0 -0
  213. package/src/assets/image/screenBlue/yq.png +0 -0
  214. package/src/assets/json/emoji.json +222 -0
  215. package/src/assets/style/base.scss +217 -0
  216. package/src/assets/style/elForm.scss +80 -0
  217. package/src/assets/style/font.scss +16 -0
  218. package/src/assets/style/index.scss +5 -0
  219. package/src/assets/style/math.scss +11 -0
  220. package/src/assets/style/mixin.scss +69 -0
  221. package/src/components/LiveCallBoard/LiveCallBoard.vue +237 -0
  222. package/src/components/LiveInviteReceive/LiveInviteReceive.vue +150 -0
  223. package/src/components/LiveMulti/LiveMulti.vue +303 -0
  224. package/src/components/LiveMultipleMeeting/LiveMultipleMeeting.vue +4469 -0
  225. package/src/components/LiveMultipleMeeting/style/index.scss +337 -0
  226. package/src/components/LivePoint/LivePoint.vue +372 -0
  227. package/src/components/LivePointMeeting/LivePointMeeting.vue +1134 -0
  228. package/src/components/LivePointMeeting/style/index.scss +202 -0
  229. package/src/components/MeetingReadyDialog/MeetingReadyDialog.vue +583 -0
  230. package/src/components/MiniumVideoDialog/MiniumVideoDialog.vue +449 -0
  231. package/src/components/other/LayoutPlaceholder.vue +184 -0
  232. package/src/components/other/addressBook.vue +1121 -0
  233. package/src/components/other/appointDialog.vue +208 -0
  234. package/src/components/other/callBoard.vue +191 -0
  235. package/src/components/other/chatArea.vue +727 -0
  236. package/src/components/other/customGroupDialog.vue +180 -0
  237. package/src/components/other/customLayout.vue +1112 -0
  238. package/src/components/other/editGroupDialog.vue +290 -0
  239. package/src/components/other/inviteNonContactDialog.vue +160 -0
  240. package/src/components/other/layoutSwitch.vue +183 -0
  241. package/src/components/other/leaveOptionDialog.vue +90 -0
  242. package/src/components/other/memberManage.vue +502 -0
  243. package/src/components/other/moreOptionDialog.vue +291 -0
  244. package/src/components/other/screenShareBoard.vue +121 -0
  245. package/src/components/other/selectDialog.vue +279 -0
  246. package/src/components/other/selectSpecialDialog.vue +234 -0
  247. package/src/components/other/settingDialog.vue +756 -0
  248. package/src/components/other/themeDialog.vue +180 -0
  249. package/src/components/other/updateNameDialog.vue +162 -0
  250. package/src/directive/clickOutside.js +58 -0
  251. package/src/directive/drag.js +165 -0
  252. package/src/directive/scale.js +22 -0
  253. package/src/directive/throttle.js +77 -0
  254. package/src/main.js +21 -0
  255. package/src/request/index.js +27 -0
  256. package/src/utils/api.js +82 -0
  257. package/src/utils/index.js +4 -0
  258. package/src/utils/livekit/live-client-esm-old.js +1 -0
  259. package/src/utils/livekit/live-client-esm.js +1 -0
  260. package/src/utils/message.js +24 -0
  261. package/src/utils/mitt.js +4 -0
  262. package/src/utils/tool.js +154 -0
@@ -0,0 +1,756 @@
1
+ <template>
2
+ <div class="addressbox">
3
+ <el-dialog :visible.sync="isaddressShow" append-to-body :show-close="false" class="setting-dialog" width="588px">
4
+ <div slot="title" class="dialog-title">
5
+ <div class="tabs">
6
+ <div v-for="item in tablsList" :key="item.id"
7
+ :class="['tabItem', activeIndex == item.id ? 'activeBorder' : '']" @click="activeIndex = item.id">
8
+ {{ item.name }}
9
+ </div>
10
+ </div>
11
+ <span class="close-icon" @click="isaddressShow = false"></span>
12
+ </div>
13
+ <div class="fgx"></div>
14
+ <div class="setter-content" v-if="activeIndex == 0">
15
+ <div class="setter-item" style="margin-bottom: 19px">
16
+ <div class="setter-item-title">扬声器</div>
17
+ <div class="setter-item-content">
18
+ <div class="setter-item-tool">
19
+ <el-select v-model="activeOutputDeviceId">
20
+ <el-option v-for="device of outputDevices" :key="device.value" :label="device.label"
21
+ :value="device.value">
22
+ </el-option>
23
+ </el-select>
24
+ <div class="detect-btn" @click="detectOutput">
25
+ {{ isOutputDetectStart ? "停止监测" : "扬声器监测" }}
26
+ </div>
27
+ </div>
28
+ <div class="setter-item-show">
29
+ <div class="setter-item-show-title">
30
+ <span>输出等级</span>
31
+ <div class="icon"></div>
32
+ </div>
33
+ <div class="setter-item-show-outter">
34
+ <div class="setter-item-show-split-layer">
35
+ <div class="setter-item-show-split" v-for="n in 9"></div>
36
+ </div>
37
+ <div class="setter-item-show-inner" :style="{ width: curOutputLevel }"></div>
38
+ </div>
39
+ </div>
40
+ <div class="setter-item-control">
41
+ <div class="setter-item-show-title">
42
+ <span>输出等级</span>
43
+ <div class="icon"></div>
44
+ </div>
45
+ <el-slider v-model="outputLevel" />
46
+ </div>
47
+ </div>
48
+ </div>
49
+ <div class="setter-item">
50
+ <div class="setter-item-title">麦克风</div>
51
+ <div class="setter-item-content">
52
+ <div class="setter-item-tool">
53
+ <el-select v-model="activeMicroDeviceId">
54
+ <el-option v-for="device of audioDevices" :key="device.value" :label="device.label"
55
+ :value="device.value">
56
+ </el-option>
57
+ </el-select>
58
+ <div class="detect-btn" @click="detectMicro">
59
+ {{ isMicroDetectStart ? "停止监测" : "开始监测" }}
60
+ </div>
61
+ </div>
62
+ <div class="setter-item-show">
63
+ <div class="setter-item-show-title">
64
+ <span>输出等级</span>
65
+ <div class="icon"></div>
66
+ </div>
67
+ <div class="setter-item-show-outter">
68
+ <div class="setter-item-show-split-layer">
69
+ <div class="setter-item-show-split" v-for="n in 9"></div>
70
+ </div>
71
+ <div class="setter-item-show-inner" :style="{ width: curMicroLevel }"></div>
72
+ </div>
73
+ </div>
74
+ <div class="setter-item-control">
75
+ <div class="setter-item-show-title">
76
+ <span>输出等级</span>
77
+ <div class="icon"></div>
78
+ </div>
79
+ <el-slider v-model="microLevel" />
80
+ </div>
81
+ </div>
82
+ </div>
83
+ </div>
84
+ <div class="setter-content" style="padding: 6px 12px 24px;" v-else-if="activeIndex == 1">
85
+ <div class="camera-setter">
86
+ <video id="camera-setter-video-ele" class="camera-setter-video" muted autoplay></video>
87
+ </div>
88
+ <div class="camera-setter-foot">
89
+ <el-select style="width: 100%;" v-model="activeVideoDeviceId">
90
+ <el-option v-for="device of videoDevices" :key="device.value" :label="device.label"
91
+ :value="device.value">
92
+ </el-option>
93
+ </el-select>
94
+ </div>
95
+ </div>
96
+ </el-dialog>
97
+ </div>
98
+ </template>
99
+ <script>
100
+ import { ShowMessage } from "@/utils/index";
101
+ import moonLight from "@/assets/audio/moon_light.ogg";
102
+
103
+ export default {
104
+ name: "SettingDialog",
105
+ props: {
106
+ outputDevices: {
107
+ type: Array,
108
+ default: () => []
109
+ },
110
+ audioDevices: {
111
+ type: Array,
112
+ default: () => []
113
+ },
114
+ videoDevices: {
115
+ type: Array,
116
+ default: () => []
117
+ },
118
+ activeDevice: {
119
+ type: Object,
120
+ default: () => ({})
121
+ }
122
+ },
123
+ data() {
124
+ return {
125
+ isaddressShow: false,
126
+ activeIndex: 0,
127
+ activeOutputDeviceId: "",
128
+ curOutputLevel: "0%",
129
+ outputLevel: 100,
130
+ activeMicroDeviceId: "",
131
+ curMicroLevel: "0%",
132
+ microLevel: 100,
133
+ allTracks: [],
134
+ activeVideoDeviceId: "",
135
+ microVolumn: 0,
136
+ isMicroDetectStart: false,
137
+ outputVolumn: 0,
138
+ isOutputDetectStart: false,
139
+ audioContext: null,
140
+ analyserNode: null,
141
+ gainNode: null,
142
+ showMessage: new ShowMessage()
143
+ };
144
+ },
145
+ computed: {
146
+ tablsList() {
147
+ return [
148
+ { id: 0, name: "音频设置" },
149
+ { id: 1, name: "视频设置" }
150
+ ];
151
+ }
152
+ },
153
+ watch: {
154
+ activeMicroDeviceId(newVal) {
155
+ if (newVal) {
156
+ this.stopmicroVolumnCheck();
157
+ }
158
+ },
159
+ microLevel(newVal) {
160
+ this.setMicroOutputVolumn(newVal / 100);
161
+ },
162
+ microVolumn(newVal) {
163
+ this.curMicroLevel = newVal > 50 ? "100%" : (newVal / 50).toFixed(2) * 100 + "%";
164
+ },
165
+ outputLevel(newVal) {
166
+ this.setOutputVolumn(newVal / 100);
167
+ },
168
+ outputVolumn(newVal) {
169
+ this.curOutputLevel = newVal > 24 ? "100%" : (newVal / 24).toFixed(2) * 100 + "%";
170
+ },
171
+ activeOutputDeviceId(newVal) {
172
+ if (this.isOutputDetectStart) {
173
+ this.stopOutputVolumeCheck();
174
+ }
175
+ },
176
+ activeIndex() {
177
+ if (this.isMicroDetectStart) {
178
+ this.stopmicroVolumnCheck();
179
+ }
180
+ if (this.isOutputDetectStart) {
181
+ this.stopOutputVolumeCheck();
182
+ }
183
+ this.streamPause();
184
+ this.initVideoStream();
185
+ },
186
+ activeVideoDeviceId(newVal) {
187
+ this.$emit("setterVideoDeviceChange", newVal);
188
+ },
189
+ isaddressShow(newVal) {
190
+ if (!newVal) {
191
+ this.$nextTick(() => {
192
+ this.streamPause();
193
+ });
194
+ }
195
+ }
196
+ },
197
+ methods: {
198
+ // 麦克风检测方法
199
+ startmicroVolumnCheck(_source, _audioContext, deviceId, _outputDeviceId, initLevel) {
200
+ let source = _source;
201
+ if (!this.audioContext) {
202
+ if (_audioContext) {
203
+ this.audioContext = _audioContext;
204
+ } else {
205
+ this.audioContext = new AudioContext();
206
+ }
207
+ }
208
+ if (!_outputDeviceId) {
209
+ this.showMessage.message("error", `请先选择音频输出扬声器`);
210
+ return;
211
+ }
212
+ this.switchOutputDevice(_outputDeviceId)
213
+ .then(async () => {
214
+ this.isMicroDetectStart = true;
215
+ const mediaOptions = {
216
+ audio: deviceId && deviceId !== "default" ? {
217
+ deviceId: deviceId,
218
+ } : "default",
219
+ };
220
+ if (!source) {
221
+ const stream = await navigator.mediaDevices.getUserMedia(mediaOptions);
222
+ source = this.audioContext.createMediaStreamSource(stream);
223
+ }
224
+ this.analyserNode = this.audioContext.createAnalyser();
225
+ this.gainNode = this.audioContext.createGain();
226
+ this.gainNode.gain.value = initLevel;
227
+ this.analyserNode.fftSize = 32;
228
+ source.connect(this.analyserNode);
229
+ this.analyserNode.connect(this.gainNode);
230
+ this.gainNode.connect(this.audioContext.destination);
231
+ // 创建数据缓冲区
232
+ const bufferLength = this.analyserNode.frequencyBinCount;
233
+ const dataArray = new Uint8Array(bufferLength);
234
+
235
+ const updateMicroVolumn = () => {
236
+ this.analyserNode.getByteFrequencyData(dataArray);
237
+
238
+ let sum = 0;
239
+ let i = 0;
240
+ while (i < bufferLength) {
241
+ sum += dataArray[i];
242
+ i++;
243
+ }
244
+ this.microVolumn = Math.floor((sum / bufferLength / 255) * 100);
245
+ if (this.isMicroDetectStart) {
246
+ requestAnimationFrame(updateMicroVolumn);
247
+ } else {
248
+ this.microVolumn = 0;
249
+ }
250
+ console.log("microVolumn", this.microVolumn);
251
+ };
252
+
253
+ updateMicroVolumn();
254
+ })
255
+ .catch((error) => {
256
+ console.error(error);
257
+ this.showMessage.message("error", `设置${_outputDeviceId}扬声器失败`);
258
+ });
259
+ },
260
+
261
+ stopmicroVolumnCheck() {
262
+ this.isMicroDetectStart = false;
263
+ if (this.gainNode) {
264
+ this.gainNode.disconnect();
265
+ }
266
+ if (this.analyserNode) {
267
+ this.analyserNode.disconnect();
268
+ }
269
+ },
270
+
271
+ setMicroOutputVolumn(level) {
272
+ if (!this.isMicroDetectStart) {
273
+ return;
274
+ } else {
275
+ this.gainNode.gain.value = level;
276
+ console.log('修改后的音量', this.gainNode.gain.value);
277
+ }
278
+ },
279
+
280
+ // 输出设备检测方法
281
+ switchOutputDevice(_deviceId) {
282
+ return new Promise((resolve, reject) => {
283
+ if (this.audioContext && this.audioContext.setSinkId) {
284
+ this.audioContext.setSinkId(_deviceId)
285
+ .then(() => {
286
+ resolve();
287
+ })
288
+ .catch((err) => {
289
+ reject(err);
290
+ });
291
+ } else {
292
+ this.showMessage.message("error", "当前浏览器版本不支持指定扬声器设备");
293
+ reject();
294
+ }
295
+ });
296
+ },
297
+
298
+ startOutputVolumeCheck(_source, _audioContext, _audioElmId = "audio-detect-player", _deviceId, initLevel) {
299
+ let source = _source;
300
+ if (!this.audioContext) {
301
+ if (_audioContext) {
302
+ this.audioContext = _audioContext;
303
+ } else {
304
+ this.audioContext = new AudioContext();
305
+ }
306
+ }
307
+ if (!_deviceId) {
308
+ this.showMessage.message("error", `请先选择要检测的扬声器`);
309
+ return;
310
+ }
311
+ console.log('要检测的扬声器', _deviceId);
312
+ this.switchOutputDevice(_deviceId).then(() => {
313
+ this.isOutputDetectStart = true;
314
+ if (!source) {
315
+ let audioElm = document.getElementById(_audioElmId);
316
+ if (!audioElm) {
317
+ audioElm = document.createElement("audio");
318
+ audioElm.id = _audioElmId;
319
+ audioElm.src = moonLight;
320
+ audioElm.autoplay = true;
321
+ document.body.appendChild(audioElm);
322
+ audioElm.onloadeddata = function () {
323
+ audioElm.play();
324
+ };
325
+ }
326
+ source = this.audioContext.createMediaElementSource(audioElm);
327
+ console.log("audioElm", audioElm, source);
328
+ }
329
+ this.analyserNode = this.audioContext.createAnalyser();
330
+ this.gainNode = this.audioContext.createGain();
331
+ this.gainNode.gain.value = initLevel;
332
+ this.analyserNode.fftSize = 32;
333
+ source.connect(this.analyserNode);
334
+ this.analyserNode.connect(this.gainNode);
335
+ this.gainNode.connect(this.audioContext.destination);
336
+ console.log('gainNode节点音量', this.gainNode.gain.value);
337
+ // 创建数据缓冲区
338
+ const bufferLength = this.analyserNode.frequencyBinCount;
339
+ const dataArray = new Uint8Array(bufferLength);
340
+
341
+ const updateOutputVolumn = () => {
342
+ this.analyserNode.getByteFrequencyData(dataArray);
343
+
344
+ let sum = 0,
345
+ i = 0;
346
+ while (i < bufferLength) {
347
+ sum += dataArray[i];
348
+ i++;
349
+ }
350
+ this.outputVolumn = Math.floor((sum / bufferLength / 255) * 100);
351
+ if (this.isOutputDetectStart) {
352
+ requestAnimationFrame(updateOutputVolumn);
353
+ } else {
354
+ this.outputVolumn = 0;
355
+ }
356
+ console.log("outputVolumn", this.outputVolumn);
357
+ };
358
+
359
+ updateOutputVolumn();
360
+ }).catch(error => {
361
+ console.error(error);
362
+ this.showMessage.message("error", `设置${_deviceId}扬声器失败`);
363
+ });
364
+ },
365
+
366
+ stopOutputVolumeCheck(_audioElmId = "audio-detect-player") {
367
+ const audioElm = document.getElementById(_audioElmId);
368
+ if (audioElm) {
369
+ audioElm.remove();
370
+ }
371
+ this.isOutputDetectStart = false;
372
+ if (this.gainNode) {
373
+ this.gainNode.disconnect();
374
+ }
375
+ if (this.analyserNode) {
376
+ this.analyserNode.disconnect();
377
+ }
378
+ },
379
+
380
+ setOutputVolumn(level) {
381
+ if (!this.isOutputDetectStart) {
382
+ return;
383
+ } else {
384
+ this.gainNode.gain.value = level;
385
+ console.log('修改后的音量', this.gainNode.gain.value);
386
+ }
387
+ },
388
+
389
+ // 组件方法
390
+ detectMicro() {
391
+ if (this.isOutputDetectStart) {
392
+ this.stopOutputVolumeCheck();
393
+ }
394
+ if (this.isMicroDetectStart) {
395
+ this.stopmicroVolumnCheck();
396
+ } else {
397
+ if (this.activeMicroDeviceId) {
398
+ this.startmicroVolumnCheck(
399
+ undefined,
400
+ undefined,
401
+ this.activeMicroDeviceId,
402
+ this.activeOutputDeviceId,
403
+ this.microLevel / 100
404
+ );
405
+ } else {
406
+ this.showMessage.message("error", "请先选择要检测的麦克风");
407
+ }
408
+ }
409
+ },
410
+
411
+ detectOutput() {
412
+ if (this.isMicroDetectStart) {
413
+ this.stopmicroVolumnCheck();
414
+ }
415
+ if (this.isOutputDetectStart) {
416
+ this.stopOutputVolumeCheck();
417
+ } else {
418
+ this.startOutputVolumeCheck(
419
+ undefined,
420
+ undefined,
421
+ "audio-detect-player",
422
+ this.activeOutputDeviceId,
423
+ this.outputLevel / 100
424
+ );
425
+ }
426
+ },
427
+
428
+ async initVideoStream() {
429
+ const stream = await navigator.mediaDevices.getUserMedia({
430
+ video: {
431
+ deviceId: this.activeVideoDeviceId
432
+ }
433
+ });
434
+ const videoEle = document.getElementById("camera-setter-video-ele");
435
+ this.allTracks = stream.getTracks();
436
+ if (videoEle) {
437
+ videoEle.srcObject = stream;
438
+ }
439
+ },
440
+
441
+ clearAllTrack() {
442
+ console.log('allTracks', this.allTracks);
443
+ if (this.allTracks.length > 0) {
444
+ this.allTracks.forEach((track) => {
445
+ track.stop();
446
+ });
447
+ }
448
+ },
449
+
450
+ streamPause() {
451
+ let videoEle = document.querySelector("#camera-setter-video-ele");
452
+ if (videoEle) {
453
+ videoEle.pause();
454
+ videoEle.srcObject = null;
455
+ videoEle.src = "";
456
+ }
457
+ this.clearAllTrack();
458
+ },
459
+
460
+ open(e) {
461
+ if (e && e.type) {
462
+ this.activeIndex = e.type;
463
+ }
464
+ this.activeOutputDeviceId = this.activeDevice.audioOutputDevice;
465
+ this.activeMicroDeviceId = this.activeDevice.audioInputDevice;
466
+ this.activeVideoDeviceId = this.activeDevice.videoDevice;
467
+ this.isaddressShow = true;
468
+ this.initVideoStream();
469
+ }
470
+ }
471
+ };
472
+ </script>
473
+ <style lang="scss" scoped>
474
+ @import "../../assets/style/mixin.scss";
475
+
476
+ :deep(.el-dialog) {
477
+ width: 588px !important;
478
+ height: 520px;
479
+ border-radius: 12px;
480
+ box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
481
+ @include dialog;
482
+
483
+ .dialog-title {
484
+ display: flex;
485
+ align-items: center;
486
+ width: 100%;
487
+ justify-content: space-between;
488
+
489
+ .tabs {
490
+ display: flex;
491
+ font-size: 16px;
492
+ color: #ffffff;
493
+ font-family: PingFangSC-Medium;
494
+
495
+ .tabItem {
496
+ margin-right: 15px;
497
+ cursor: pointer;
498
+ }
499
+
500
+ .activeBorder {
501
+ position: relative;
502
+
503
+ &::after {
504
+ content: "";
505
+ display: block;
506
+ position: absolute;
507
+ left: 12px;
508
+ bottom: -6px;
509
+ width: 40px;
510
+ height: 3px;
511
+ background: #1f63fb;
512
+ border-radius: 8px 8px 0px 0px;
513
+ }
514
+ }
515
+ }
516
+
517
+ .close-icon {
518
+ width: 16px;
519
+ height: 16px;
520
+ background: var(--close-icon) no-repeat center center / 100% 100%;
521
+ cursor: pointer;
522
+ }
523
+ }
524
+
525
+ .fgx {
526
+ margin: 0 0 20px 0;
527
+ height: 2px;
528
+ background: rgba(28, 36, 47, 0.6);
529
+ }
530
+
531
+ .setter-content {
532
+ border-radius: 6px;
533
+ border: 2px solid rgba(67, 85, 110, 0.4);
534
+ padding: 6px 26px 24px;
535
+ font-family: PingFang SC;
536
+ font-weight: 500;
537
+ font-size: 16px;
538
+ color: #ffffff;
539
+
540
+ .setter-item {
541
+ width: 100%;
542
+
543
+ &-title {
544
+ line-height: 40px;
545
+ border-bottom: 1px solid #1c242f;
546
+ margin-bottom: 10px;
547
+ }
548
+
549
+ &-content {
550
+ width: 100%;
551
+
552
+ .setter-item-tool {
553
+ width: 100%;
554
+ display: flex;
555
+ flex-wrap: nowrap;
556
+ align-items: center;
557
+ justify-content: space-between;
558
+ margin-bottom: 19px;
559
+
560
+ .detect-btn {
561
+ cursor: pointer;
562
+ background: rgba(28, 36, 47, 0.6);
563
+ border-radius: 8px;
564
+ line-height: 40px;
565
+ padding: 0 20px;
566
+ white-space: nowrap;
567
+ }
568
+ }
569
+
570
+ .setter-item-show {
571
+ width: 100%;
572
+ display: flex;
573
+ flex-wrap: nowrap;
574
+ align-items: center;
575
+ margin-bottom: 28px;
576
+
577
+ &-title {
578
+ font-size: 16px;
579
+ display: flex;
580
+ align-items: center;
581
+
582
+ span {
583
+ white-space: nowrap;
584
+ }
585
+
586
+ .icon {
587
+ width: 20px;
588
+ height: 20px;
589
+ background: var(--audio-level-icon) no-repeat center center / 100% 100%;
590
+ margin: 0 10px;
591
+ }
592
+ }
593
+
594
+ &-outter {
595
+ flex-shrink: 0;
596
+ width: calc(100% - 104px);
597
+ height: 8px;
598
+ background-color: #43556e;
599
+ border-radius: 2px;
600
+ position: relative;
601
+
602
+ .setter-item-show-split-layer {
603
+ position: absolute;
604
+ top: 0;
605
+ left: 0;
606
+ width: 100%;
607
+ height: 100%;
608
+ display: flex;
609
+ align-items: center;
610
+ justify-content: space-evenly;
611
+
612
+ .setter-item-show-split {
613
+ height: 100%;
614
+ width: 6px;
615
+ background-color: #252e3d;
616
+ }
617
+ }
618
+
619
+ .setter-item-show-inner {
620
+ height: 100%;
621
+ background-color: #5fa7fd;
622
+ border-radius: 2px;
623
+ }
624
+ }
625
+ }
626
+
627
+ .setter-item-control {
628
+ width: 100%;
629
+ display: flex;
630
+ flex-wrap: nowrap;
631
+ align-items: center;
632
+
633
+ &-title {
634
+ font-size: 16px;
635
+ display: flex;
636
+ align-items: center;
637
+
638
+ span {
639
+ white-space: nowrap;
640
+ }
641
+
642
+ .icon {
643
+ width: 20px;
644
+ height: 20px;
645
+ margin: 0 10px;
646
+ }
647
+ }
648
+
649
+ .el-slider {
650
+ width: calc(100% - 104px);
651
+ }
652
+ }
653
+ }
654
+ }
655
+
656
+ .camera-setter {
657
+ width: 100%;
658
+ height: 336px;
659
+ border-radius: 8px;
660
+ position: relative;
661
+ margin-bottom: 16px;
662
+
663
+ &-video {
664
+ width: 100%;
665
+ height: 100%;
666
+ border-radius: 8px;
667
+ object-fit: cover;
668
+ }
669
+ }
670
+
671
+ .meeting-ordinary-setter {
672
+ width: 100%;
673
+ margin-top: 18px;
674
+ &-item {
675
+ height: 32px;
676
+ cursor: pointer;
677
+ font-size: 14px;
678
+ font-weight: 400;
679
+ display: flex;
680
+ align-items: center;
681
+ flex-wrap: nowrap;
682
+ padding-left: 8px;
683
+ &:not(:last-child) {
684
+ margin-bottom: 12px;
685
+ }
686
+ &-check {
687
+ flex-shrink: 0;
688
+ width: 16px;
689
+ height: 16px;
690
+ border: 1px solid #ccc8c8;
691
+ margin-right: 10px;
692
+ }
693
+ &-name {
694
+ display: inline-block;
695
+ flex-shrink: 0;
696
+ white-space: nowrap;
697
+ width: calc(100% - 45px);
698
+ max-width: calc(100% - 45px);
699
+ overflow: hidden;
700
+ text-overflow: ellipsis;
701
+ }
702
+ &-checked {
703
+ .meeting-ordinary-setter-item-check {
704
+ background: var(--dialog-item-checked-icon) no-repeat center / 100% 100%;
705
+ }
706
+ }
707
+ }
708
+ }
709
+
710
+ .camera-setter-foot {
711
+ width: 100%;
712
+ display: flex;
713
+ align-items: center;
714
+ justify-content: center;
715
+ }
716
+ }
717
+ }
718
+
719
+ :deep(.el-select) {
720
+ width: 366px;
721
+
722
+ // .el-select__wrapper {
723
+ // box-shadow: none;
724
+ // background-color: transparent;
725
+ // border-radius: 6px;
726
+ // border: 1px solid var(--input-border-color);
727
+ // padding: 0 14px;
728
+ // height: 40px;
729
+ // line-height: 40px;
730
+
731
+ // .el-select__placeholder {
732
+ // color: var(--input-placeholder-color);
733
+ // font-family: var(--main-font);
734
+ // }
735
+
736
+ // .el-select__selected-item {
737
+ // color: var(--theme-font-color);
738
+ // font-size: 16px;
739
+ // font-weight: 400;
740
+ // }
741
+ // }
742
+ .el-input__inner {
743
+ box-shadow: none;
744
+ background-color: transparent;
745
+ border-radius: 6px;
746
+ border: 1px solid var(--input-border-color);
747
+ padding: 0 14px;
748
+ height: 40px;
749
+ line-height: 40px;
750
+ color: var(--theme-font-color);
751
+ &::placeholder {
752
+ color: var(--input-placeholder-color);
753
+ }
754
+ }
755
+ }
756
+ </style>