网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站设计 > CSS, DIV, HTML
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

Reply
 
Thread Tools Display Modes
  #1   IP: 112.84.222.200
Old 2016-10-23, 10:09 PM
Cedar Falls Cedar Falls is offline
初级会员
 
Join Date: 2014-02-26
Posts: 1
Cedar Falls 现在声名狼藉
Default html5如何实现自动播放视频

HTML5 是下一代的 HTML, 提供了展示视频的标准,规定了一种通过 video 元素来包含视频的标准方法。


Video有以下的属性。

autoplay    autoplay    如果出现该属性,则视频在就绪后马上播放。    
controls     controls    如果出现该属性,则向用户显示控件,比如播放按钮。    
height        pixels    设置视频播放器的高度。    
loop           loop    如果出现该属性,则当媒介文件完成播放后再次开始播放。    
preload      preload    如果出现该属性,则视频在页面加载时进行加载,并预备播放。
如果使用 "autoplay",则忽略该属性。

src              url    要播放的视频的 URL。    
width           pixels    设置视频播放器的宽度。    

其中,如果想要实现自动播放,可以在Video里面加上autoplay属性就可以了。以下是例子。
<!DOCTYPE HTML>
<html>
<body>

<video width="320" height="240" controls="controls" autoplay>
  <source src="/i/movie.ogg" type="video/ogg">
  <source src="/i/movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>

</body>
</html>
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 2 (0 members and 2 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 10:45 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.