H5呼叫照相機等裝置

2021-10-11 00:22:34 字數 606 閱讀 6571

使用input標籤 type值為file,可以呼叫系統預設的照相機、相簿、攝像機、錄音功能:

屬性

說明accept

開啟的系統檔案目錄

capture

系統所捕獲的預設裝置,camera:照相機;camcorder:攝像機;microphone:錄音;

multiple

多選,multiple優先順序高於capture,

測試發現存在很多相容性問題,下面將測試出的部分結果列出:

裝置安卓

ioscamera

相機、相簿、檔案管理器等混合選擇項

相機camcorder

攝像機攝像機

microphone

錄音相機

安卓呼叫相機.jpg

h5呼叫相機相簿

我們利用input 輸入框 把type屬性改為file,然後呼叫系統預設相機,攝像,系統相簿。accept 表示要開啟的檔案型別 capture 表示可以捕獲到系統預設的裝置 input type file accept image capture camera 相機 input type file...

android 呼叫系統照相機和攝像機

檢視系統照相機原始碼,找到清單檔案檢視 檢視意圖過濾器,action 是android.media.action.image capture category是 android.intent.category.default 獲取intent 物件,通過 new出來 呼叫intent 物件的seta...

android 呼叫系統照相機和攝像機

檢視系統照相機原始碼,找到清單檔案檢視 檢視意圖過濾器,action 是android.media.action.image capture category是 android.intent.category.default 獲取intent 物件,通過 new出來 呼叫intent 物件的seta...