使用input:file, 指定capture屬性調用默許相機,攝像,錄音功能
圖檔
<input type="file" accept="image/*" capture="camera">
視訊
<input type="file" accept="video/*" capture="camcorder">
錄音
<input type="file" accept="audio/*" capture="microphone">
注:蘋果手機錄音不支援,還是打開視訊音頻。
參考
http://www.myexception.cn/web/1947138.html