-1
我想製作一個自定義播放器設計,並遵循HTML5自定義控件教程並出現問題。html5視頻自定義控件
在執行unmute
它顯示[objectHTML button Element]
,那麼我該怎麼做?
<!DOCTYPE html>
<html>
<head>
<style>
</style>
</head>
<body>
<video id="myVideo" width="640" height="320" autoplay>
<source src="http://vjs.zencdn.net/v/oceans.mp4"></source>
</video><br>
<button id="plbn" onclick="playPause()">Pause</button>
<button id="mute" onclick="mutevol()">Mute</button>
<script>
var vid = document.getElementById("myVideo");
function playPause() {
var plbtn = document.getElementById("plbn");
if (vid.paused)
{vid.play();plbtn.innerHTML = "Pause";}
else
{vid.pause();plbtn.innerHTML = "Play";}
}
function mutevol() {
var mutebtn = document.getElementById("mute");
if(vid.muted == true)
{vid.muted = false;
mutebtn.innerHTML = mute;}
else
{vid.muted = true;
mutebtn.innerHTML = unmute;} /*On execution it shows "[objectHTML button ELement]", so what do i do? */
}
</script>
</body>
</html>
靜音和取消靜音需要引用 – zer00ne