ভিডিও ডিউরেশন প্রোপার্টি
HTML DOM Video duration প্রোপার্টি ভিডিওর দৈর্ঘ্য (সেকেন্ডে) নির্দেশকারী একটি নম্বর ফেরত দেয়।
দ্রষ্টব্য - লাইভ স্ট্রিমের জন্য এটি 'Inf' ফেরত দেয় যা অসীম কারণ লাইভ স্ট্রিমের কোনো পূর্বনির্ধারিত দৈর্ঘ্য নেই।
সিনট্যাক্স
স্ট্রিং মান ফেরত দেওয়া
mediaObject.duration
উদাহরণ
HTML DOM Video duration প্রোপার্টির একটি উদাহরণ -
<!DOCTYPE html> <html> <head> <title>HTML DOM Video duration</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-duration</legend> <video id="demo" width="320" controls><source src="https://www.tutorialspoint.com/html5/foo.mp4" type="video/mp4"></video><br> <input type="button" onclick="getTrackDetails()" value="How many seconds of content is this video?"> <div id="divDisplay"></div> </fieldset> </form> <script> var divDisplay = document.getElementById("divDisplay"); var demo = document.getElementById("demo"); function getTrackDetails() { divDisplay.textContent = 'Duration: '+demo.duration+' seconds'; } </script> </body> </html>
আউটপুট
'How many seconds of content is this video?' বাটনে ক্লিক করার আগে -

'How many seconds of content is this video?' বাটনে ক্লিক করার পর -
