我想播放/暫停,同時點擊視頻 我的代碼是在這裏,HTML5視頻播放器點擊數播放/暫停工作不
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="javascript">
$(document).ready(function() {
var myVideo = document.getElementById("video1");
function playPause()
{
if (myVideo.paused)
myVideo.play();
else
myVideo.pause();
}
//your code here
});
</script>
</head>
<body>
<video id="video1" onClick="playPause();" width="320" height="240" >
<source src="https://www.w3schools.com/html/movie.mp4" type="video/mp4">
</video>
</body>
</html>
在哪裏我堅持?它顯示錯誤如ReferenceError: playPause is not defined