添加和删​​除HTML5的音频播放器控件 [英] add and remove controls on HTML5 audio player

查看:134
本文介绍了添加和删​​除HTML5的音频播放器控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何添加和删除一个HTML5音频播放器的具体控制?我想删除的音量控制,时间显示和进度条。我用下面的code展现给玩家。

How do I add and remove specific controls on an HTML5 audio player? I'd like to remove the volume control, time display, and the progress bar. I'm using the following code to show the player.

<audio controls>
<source src="http://example.mp3" type="audio/mpeg"> 
Your browser does not support this audio format.
</audio> 

<style>
audio { width: 10%; display: block;}
</style>

感谢。

推荐答案

您不能混用并匹配本地控制。你要么拥有所有的本地控件,或者你有没有本地控制。

You can't mix and match native controls. You either have all the native controls or you have no native controls.

如果您想进行一些控制,那么你需要使用JavaScript API和复制它们的DOM。

If you want some controls, then you'll need to reproduce them using the JavaScript APIs and DOM.

这篇关于添加和删​​除HTML5的音频播放器控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆