Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
562 views
in Technique[技术] by (71.8m points)

javascript - navigator.mediaDevices.enumerateDevices在iOS Safari(13.2.3)上不返回任何音频输入设备(navigator.mediaDevices.enumerateDevices does not return any audioinput devices on iOS Safari (13.2.3))

I am trying to record audio on iOS Safari (13.2.3), but Safari is not providing access to the microphone.(我正在尝试在iOS Safari(13.2.3)上录制音频,但Safari不提供对麦克风的访问。)

When I call navigator.mediaDevices.enumerateDevices , it only returns a single MediaDeviceInfo (kind: videoinput )(当我调用navigator.mediaDevices.enumerateDevices ,它仅返回一个MediaDeviceInfo (种类: videoinput )) I read elsewhere to call navigator.mediaDevices.getUserMedia({audio: true}) first, but that gives an Invalid constraint error.(我在其他地方读过,首先要调用navigator.mediaDevices.getUserMedia({audio: true}) ,但这会导致无效约束错误。) getSupportedConstraints does not show that audio/video are valid options (only aspectRatio, deviceId, echoCancellation, facingMode, frameRate, groupId, height, sampleRate, sampleSize, volume, width ).(getSupportedConstraints没有显示音频/视频是有效选项(仅aspectRatio, deviceId, echoCancellation, facingMode, frameRate, groupId, height, sampleRate, sampleSize, volume, width )。) This is on an ipod touch 7th edition, which definitely has a microphone;(这是在ipod touch第七版上,它肯定有麦克风。) eg.(例如。) Siri can hear me.(Siri可以听到我的声音。) I'm not sure why the microphone isn't showing up for Safari, while the camera is.(我不确定为什么没有摄像头的麦克风无法显示在Safari中。)   ask by Chris translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Unfortunately it doesn't look like the iPod Touch (7th edition; 2019) supports microphone-only access in Safari.(不幸的是,它看起来不像iPod Touch(第7版; 2019年)在Safari中支持仅麦克风访问。)

When I tested on iPhones using the same iOS version (13.2.3), the code worked flawlessly, even when the iPhones did not have SIM cards.(当我在使用相同iOS版本(13.2.3)的iPhone上进行测试时,即使iPhone没有SIM卡,代码也可以正常工作。) (Tested both on an iPhone 7 and iPhone 8).((在iPhone 7和iPhone 8上都经过测试)。)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...