HTML DOM 影片 seeking 屬性
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="https://tutorialspoint.tw/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>輸出
在影片查詢之前和之後 −

在影片查詢期間 −

廣告
資料結構
網路
關係型資料庫管理系統
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP