网页播放器的样式可以修改吗?

网页上视频播放器的样式可以修改吗?
如果可以修改的话,有哪些属性进行定义呢?有推荐的网站吗

阅读 11.4k
4 个回答

播放器可以弄自定义样式的
html:

<div style="text-align:center;">
    <div>
        <button onclick="playPause()">播放/暂停</button> 
        <button onclick="makeBig()">大</button>
        <button onclick="makeNormal()">中</button>
        <button onclick="makeSmall()">小</button>
    </div>
    <video id="video1" width="420" style="margin-top:15px;">
        <source src="http://www.w3school.com.cn/i/movie.mp4" type="video/mp4" />
        <source src="http://www.w3school.com.cn/i/movie.ogg" type="video/ogg" />
        Your browser does not support HTML5 video.
</video>
</div> 

js:

var myVideo=document.getElementById("video1");
function playPause(){ 
    if (myVideo.paused) 
        myVideo.play(); 
    else 
        myVideo.pause(); 
} 
function makeBig(){ 
    myVideo.width=560; 
} 
function makeSmall(){ 
    myVideo.width=320; 
} 
function makeNormal(){ 
    myVideo.width=420; 
} 

布局样式在css里改可以了
参考http://w3school.com.cn/html5/html_5_video_dom.asp

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进