Commit 00898816 authored by 水玉婷's avatar 水玉婷
Browse files

feat:移除麦克风检查,并添加调试工具

parent 20c5890a
...@@ -11,5 +11,18 @@ ...@@ -11,5 +11,18 @@
<body> <body>
<div id="app"></div> <div id="app"></div>
<script type="module" src="/src/main.js"></script> <script type="module" src="/src/main.js"></script>
<!-- 根据环境加载eruda.js -->
<script>
var env = window.location.href;
if (env.indexOf('//xc.cmic.com.cn') === -1) {
var script = document.createElement('script');
script.type = 'module';
script.src = 'https://lib.baomitu.com/eruda/2.4.1/eruda.min.js';
document.getElementsByTagName('head')[0].appendChild(script);
script.onload = function () {
window.eruda.init();
}
}
</script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -259,6 +259,7 @@ const isMediaRecorderSupported = () => { ...@@ -259,6 +259,7 @@ const isMediaRecorderSupported = () => {
const checkMicrophonePermission = async () => { const checkMicrophonePermission = async () => {
try { try {
const permissionStatus = await navigator.permissions.query({ name: 'microphone' as PermissionName }); const permissionStatus = await navigator.permissions.query({ name: 'microphone' as PermissionName });
console.log('麦克风权限查询结果:', permissionStatus);
if (props.debug) { if (props.debug) {
console.log('麦克风权限状态:', permissionStatus.state); console.log('麦克风权限状态:', permissionStatus.state);
...@@ -282,12 +283,12 @@ const startRecording = async () => { ...@@ -282,12 +283,12 @@ const startRecording = async () => {
if (props.disabled || isRecording.value || !isFullScreen.value) return if (props.disabled || isRecording.value || !isFullScreen.value) return
// 检查权限 // 检查权限
const hasPermission = await checkMicrophonePermission(); // const hasPermission = await checkMicrophonePermission();
if (!hasPermission) { // if (!hasPermission) {
emit('error', '麦克风权限被拒绝'); // emit('error', '麦克风权限被拒绝');
exitFullScreen(); // exitFullScreen();
return; // return;
} // }
// 检查浏览器支持 // 检查浏览器支持
if (!isMediaRecorderSupported()) { if (!isMediaRecorderSupported()) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment