Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
HTML Articles
Page 27 of 151
HTML DOM Video duration Property
The HTML DOM Video duration property returns the duration of a video in seconds as a numeric value. This read-only property is essential for creating custom video controls, progress bars, and displaying video information to users. Note − For live streams, the duration property returns Infinity because live content has no predefined end time. Syntax Following is the syntax for accessing the duration property − videoObject.duration Return Value The duration property returns a numeric value representing − The length of the video in seconds (for recorded videos) Infinity for live ...
Read MoreHTML DOM Video ended Property
The HTML DOM Video ended property returns a boolean value indicating whether a video has finished playing. It returns true when the video has reached its end, and false otherwise. This property is read-only and useful for detecting when video playback is complete. Syntax Following is the syntax for accessing the ended property − videoElement.ended Return Value The ended property returns a Boolean value − true − The video has reached its end false − The video is still playing or paused before the end Example − Checking Video ...
Read MoreHTML DOM Video height Property
The HTML DOM Video height property gets or sets the height of a video element in pixels. This property corresponds to the height attribute of the element and allows dynamic resizing of video content through JavaScript. Syntax Following is the syntax for getting the height property − mediaObject.height Following is the syntax for setting the height property − mediaObject.height = number Parameters The height property accepts the following parameter − number − A numeric value representing the height of the video element in pixels. The value ...
Read MoreHTML DOM Video loop Property
The HTML DOM Video loop property controls whether a video element will automatically restart from the beginning when it reaches the end. This property returns a boolean value and can be set to true or false. Syntax Following is the syntax for getting the loop property value − mediaObject.loop Following is the syntax for setting the loop property − mediaObject.loop = booleanValue Parameters The booleanValue can be one of the following − Value Description true The video will automatically restart from ...
Read MoreHTML DOM Video muted Property
The HTML DOM Video muted property controls whether the video's audio is silenced. This property returns a boolean value indicating the current mute state and allows you to programmatically mute or unmute video elements. Syntax Following is the syntax for getting the muted property − videoObject.muted Following is the syntax for setting the muted property − videoObject.muted = booleanValue Parameters The booleanValue can be one of the following values − Value Description true The video audio is muted (no sound will ...
Read MoreHTML DOM Video networkState Property
The HTML DOM Video networkState property returns a numeric value that represents the current network state of a video element. This read-only property helps developers understand whether the video is loading, idle, or encountering network issues. Syntax Following is the syntax to get the networkState property − videoElement.networkState Return Value The networkState property returns one of the following numeric values − 0 (NETWORK_EMPTY) − The video element has not yet been initialized. No network activity has started. 1 (NETWORK_IDLE) − The video element is active and has selected a resource, but ...
Read MoreHTML DOM Video Object
The HTML DOM Video Object represents the element in the Document Object Model. It provides a JavaScript interface to control video playback, access video properties, and manage video-related events programmatically. Creating a Video Object You can access an existing video element or create a new one using JavaScript − // Access existing video element var videoObject = document.getElementById("myVideo"); // Create new video element var videoObject = document.createElement("VIDEO"); Video Object Properties The Video Object provides numerous properties to control and monitor video playback. Here are the key properties − ...
Read MoreHTML DOM Video preload Property
The HTML DOM Video preload property controls when video data should be loaded. This property accepts string values that indicate the preferred loading behavior, helping optimize page performance and bandwidth usage. The default value is metadata. Syntax Following is the syntax to get the current preload setting − mediaObject.preload Following is the syntax to set the preload property − mediaObject.preload = "auto|metadata|none" Property Values The preload property accepts the following string values − Value Description auto The browser should load the ...
Read MoreHTML DOM Video readyState Property
The HTML DOM Video readyState property returns a numeric value that represents the current loading state of a video element. This property is essential for determining whether the video has enough data to begin playback or if it's still loading. Syntax Following is the syntax to get the ready state of a video element − videoElement.readyState Return Value The readyState property returns an integer value from 0 to 4, each representing a different loading state − 0 (HAVE_NOTHING) − No information is available about the media resource 1 (HAVE_METADATA) − Metadata ...
Read MoreHTML DOM WheelEvent deltaX Property
The HTML DOM WheelEvent deltaX property returns a signed number indicating horizontal scroll direction. It returns a positive value when scrolling right, a negative value when scrolling left, and zero for all other directions. Syntax Following is the syntax for accessing the deltaX property − event.deltaX Return Value The deltaX property returns a double-precision floating-point number representing the horizontal scroll amount − Positive value − User scrolled to the right Negative value − User scrolled to the left Zero (0) − No horizontal scrolling occurred WheelEvent ...
Read More