Open In App

HTML | DOM Video controller Property

Last Updated : 01 Nov, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

The controller property returns the present media controller of the video. By default, the video element doesn’t have a media controller. The media controller property will return a MediaController object.

Syntax

videoObject.controller

Return Value

  • MediaController: It Represent the media controller of video
    Object: MediaController Object properties/methods:

    • buffered – get the buffered ranges of the video
    • seekable – get the seekable ranges of the video
    • duration – get the duration of the video
    • currentTime – get or set the playback position of the video
    • paused – check if the video is paused
    • play() – play the video
    • pause() – pause the video
    • played – check if the video been played
    • defaultPlaybackRate – get or set the default playback rate of the video
    • playbackRate – get or set the present playback rate of the video
    • volume – get or set the volume of the video
    • muted – get or set if the video is muted

Example:




<!DOCTYPE html>
<html>
  
<body>
    <video id="Test_Video" width="360" height="240" controls>
  
        <source id="mp4_source" src="sample2.mp4" type="video/mp4">
  
        <source id="ogg_source" src="sample2.ogg" type="video/ogg">
    </video>
    <br>
    <button onclick="myVideo()" type="button">Click It</button>
    <br>
  
    <script>
        var v = document.getElementById("Test_Video");
  
        function myVideo() {
            alert("Controller: " + v.controller);
        }
    </script>
  
</body>
  
</html>


Output:

Supported Browsers: The browsers supported by HTML Video controller Property are listed below:

  • Google Chrome Not Supported
  • Internet Explorer Not Supported
  • Firefox Not Supported
  • Apple Safari Not Supported
  • Opera Not Supported

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads