苹果机修复ios无法开启录音的bug
This commit is contained in:
@@ -133,18 +133,10 @@
|
||||
URL.revokeObjectURL(blobUrl);
|
||||
const mediaStream = new MediaStream();
|
||||
} else if (os === 'iOS') {
|
||||
console.log('是iOS');
|
||||
audioContext = new AudioContext();
|
||||
// 加载并初始化AudioWorklet
|
||||
await audioContext.audioWorklet.addModule('static/dist/processor.worklet.js');
|
||||
|
||||
await audioContext.audioWorklet.addModule('static/js/processor.worklet.js');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
mediaStream = await navigator.mediaDevices.getUserMedia({
|
||||
audio: {
|
||||
sampleRate: options.sampleRate,
|
||||
|
||||
@@ -124,9 +124,10 @@
|
||||
import { ref, unref, onMounted, computed, nextTick } from 'vue';
|
||||
import { onShow, onLoad, onUnload, onLaunch, onBackPress } from '@dcloudio/uni-app';
|
||||
import common from '@/common/common';
|
||||
import {getPhoneEnvBool} from '@/common/common';
|
||||
import TouchBtn from './components/touchBtn.vue';
|
||||
import ImagePreview from '@/components/image-preview/image-preview.vue';
|
||||
import { commonUploadVoiceFile } from '@/api/common.js';
|
||||
import { commonUploadVoiceFile} from '@/api/common.js';
|
||||
import { queryTraPartnerCharacterInfoById, partnerChatReportTrigger } from '@/api/sparring.js';
|
||||
import { useSocketStore } from '@/store/socket.js';
|
||||
import { useStorageStore } from '@/store/storage.js';
|
||||
@@ -240,9 +241,15 @@
|
||||
};
|
||||
|
||||
const toTalking = async () => {
|
||||
|
||||
try {
|
||||
await initRecord();
|
||||
console.log('权限状态');
|
||||
console.log('申请权限',getPhoneEnvBool('AND'));
|
||||
if(getPhoneEnvBool('AND')){
|
||||
console.log('申请权限');
|
||||
// await initRecord();
|
||||
}
|
||||
|
||||
|
||||
common.setPageCache('tipMsgsceneDesc', {
|
||||
sceneDesc: detailInfo.value.sceneDesc
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user