如表8-2所示,有一些Android設備的瀏覽器支援HTML Media Capture,如果你使用
capture
屬性的話,當控制項啟動時,會自動地開啟適當的App(照相機或錄音機),而
不會顯示任何對話方塊。
有一些瀏覽器遇到檔案上傳控制項時,會開啟一個檔案系統瀏覽器,用來打開內部或
外接記憶卡來選擇檔案並且將它上傳。如Nokia S40的Xpress 瀏覽器與社交手機上的
Opera Mini。
我們可以按照檔案上傳的相容性,將行動瀏覽器分類為:
完全不相容
你的欄位會被停用。
基本相容
使用者可以上傳一個檔案,但是沒有篩選功能,而且不支援HTML Media Capture。
有一些瀏覽器會讓使用者使用照相App 在螢幕擷取檔案。
可使用篩選器
使用者只能上傳一個檔案,但是你可以使用
accept
屬性來篩選檔案(通常至少可以
篩選圖像與視訊)。
HTML5
相容
使用者可以上傳一或多個檔案,而且完全可以使用
accept
屬性。
HTML Media Capture
相容
所有選項都可使用。通常在使用擷取功能時,不能同時使用
multiple
。
表8-2 是本書編著時期的瀏覽器相容性摘要。
表8-2檔案上傳相容性
瀏覽器∕平台基本支援檔案選擇器∕擷取accept 屬性multiple屬性capture 屬性
iOS Safari<=5.1 無,
6.0+ 有
選擇器與照相機擷取有,只有圖像與
視訊
有無
Android
瀏覽器
<=2.1 無,
2.2+ 有
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.