HTML DOM Video seeking 属性
htmlweb developmentfront end technology更新于 2024/5/26 2:52:17
HTML DOM Video seeking 属性返回一个布尔值 (true/false),表示用户是否正在定位(将当前播放移动到新位置)正在播放的视频。
语法
以下是语法 −
返回布尔值
mediaObject.seeking
让我们看一个 HTML DOM Video seeking 属性的示例 −
示例
<!DOCTYPE html>
<html>
<head>
<title>HTML DOM Video seeking</title>
<style>
* {
padding: 2px;
margin:5px;
}
form {
width:70%;
margin: 0 auto;
text-align: center;
}
input[type="button"] {
border-radius: 10px;
}
</style>
</head>
<body>
<form>
<fieldset>
<legend>HTML-DOM-Video-seeking</legend>
<video id="demo" width="320" onseeking="getTrackDetails()" onseeked="getTrackDetails()"
controls><source src="http://www.tutorialspoint.com/html5/foo.mp4"
type="video/mp4"></video><br>
<div id="divDisplay"></div>
</fieldset>
</form>
<script>
var divDisplay = document.getElementById("divDisplay");
var demo = document.getElementById("demo");
demo.autoplay =true;
function getTrackDetails() {
if(demo.seeking)
divDisplay.textContent = 'To understand the concept watch full video';
}
</script>
</body>
</html>
输出
视频搜索前后 −

视频搜索过程中 −

相关文章
有用资源
html 参考教程 - 该教程包含有关 html 的更多信息:https://www.cainiaomax.com/html/

