在網頁放video除了用flash video 外,可用HTML5的code 。
<video width=”320″ height=”240″ controls=”controls”>
<source src=”movie.mp4″ type=”video/mp4″ />
Your browser does not support the video tag.
</video>
Attribute
- width=”320″ 寬 320 px
- height=”240″ 高 240 px [width & height 按 aspect ratio 放大縮小]
- src=”movie.mp4″ 檔案path 及名稱
大家可以修改attribute 來
- 不顯示控制列
- 自動播放
Flash video vs HTML5 <video>
Flash video | HTML5<video> | |
---|---|---|
Install Plugin? | Need to install browser plugin, Flash Player, to play the video. | No plugin is needed |
Browser compatibility | All browser installed with plugin can play the video | Not all browser support HTML5 |
Supported file format | FLV | MP4, WebM & Ogg |
Browser | MP4 | WebM | Ogg |
---|---|---|---|
Internet Explorer 9 | YES | NO | NO |
Firefox 4.0 | NO | YES | YES |
Google Chrome 6 | YES | YES | YES |
Apple Safari 5 | YES | NO | NO |
Opera 10.6 | NO | YES | YES |
- MP4 = MPEG 4 files with H264 video codec and AAC audio codec
- WebM = WebM files with VP8 video codec and Vorbis audio codec
- Ogg = Ogg files with Theora video codec and Vorbis audio codec
Recent Comments