若要在手機網頁中開啟相機或錄影功能,可利用 file input 搭配 accept 與 capture 屬性。
<input type="file" accept="video/*;capture=camcorder" />
其中 accept 限制可選檔案類型,capture 則提示瀏覽器調用裝置的相機或錄影裝置。實際支援程度仍依行動瀏覽器而異。