Found 2416 Articles for HTML

HTML DOM Video preload Property

AmitDiwan
Updated on 18-Feb-2021 04:44:59

100 Views

The HTML DOM Video preload property returns a string corresponding to when the creator thinks the video data should load. Though sometimes this may be ignored.Default value is ‘metadata’.SyntaxFollowing is the syntax −Returning string valuemediaObject.preloadSetting preload to a stringmediaObject.preload = “auto|metadata|none”Let us see an example of HTML DOM Video preload property −Example Live Demo HTML DOM Video preload    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    input[type="button"] {       ... Read More

HTML DOM Video poster Property

AmitDiwan
Updated on 18-Feb-2021 05:21:34

72 Views

The HTML DOM Video poster property returns/sets a string corresponding to the url of an image shown until the video is played or network state is equal to ‘2’.SyntaxFollowing is the syntax −Returning string valuemediaObject.posterSetting poster to a URLStringmediaObject.poster = URLStringLet us see an example of HTML DOM Video poster property −ExampleLive Demo HTML DOM Video poster    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    input[type="button"] {       ... Read More

HTML DOM Video played Property

AmitDiwan
Updated on 18-Feb-2021 05:22:38

86 Views

The HTML DOM Video played property returns a TimeRanges object containing information about the video’s played range length and its start, end position.SyntaxFollowing is the syntax −Returning TimeRanges ObjectmediaObject.playedLet us see an example of Video played property −ExampleLive Demo HTML DOM Video played    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    input[type="button"] {       border-radius: 10px;    }             ... Read More

HTML DOM Video playbackRate Property

AmitDiwan
Updated on 18-Feb-2021 05:23:51

82 Views

The HTML DOM Video playbackRate property returns/sets a number corrosponding to current playback rate of media.SyntaxFollowing is the syntax −Returning playbackRate as a numbermediaObject.playbackRateSetting playbackRate to a numbermediaObject.playbackRate = numberNOTE − Number has a max value of ‘16’ and if ‘0.0’ video is still.Let us see an example of Video playbackRate property −ExampleLive Demo HTML DOM Video playbackRate    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    input[type="button"] {     ... Read More

HTML DOM Video play( ) Method

AmitDiwan
Updated on 18-Feb-2021 05:25:22

166 Views

The HTML DOM Video play() is used for playing the current media content and to stopping media use pause().SyntaxFollowing is the syntax −videoObject.play()Let us see an example of Video play() property −ExampleLive Demo HTML DOM Video play()    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    input[type="button"] {       border-radius: 10px;    }                    HTML-DOM-Video-play( )                                                      var divDisplay = document.getElementById("divDisplay");    var demo = document.getElementById("demo");    function setControls(val) {       if(val === 1){          demo.play();          divDisplay.textContent = 'Video is playing';       }       else{          demo.pause();          divDisplay.textContent = 'Video is paused';       }      } OutputClicking ‘Play’ button −Clicking ‘Pause’ button −

HTML DOM Video paused Property

AmitDiwan
Updated on 18-Feb-2021 05:26:35

79 Views

The HTML DOM Video paused property returns a boolean (true/false) corresponding to whether the video is playing or not.SyntaxFollowing is the syntax −Returning boolean valuemediaObject.pausedLet us see an example of HTML DOM Video paused property −ExampleLive Demo HTML DOM Video paused    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    input[type="button"] {       border-radius: 10px;    }    .dimLight {       background-color: #000;    } ... Read More

HTML DOM Video Object

AmitDiwan
Updated on 21-Dec-2021 09:02:57

184 Views

The HTML DOM Video Object in HTML represents the element.Creating a  elementvar videoObject = document.createElement(“VIDEO”)Here, “videoObject” can have the following properties −PropertyDescriptionaudioTracksItreturns an AudioTrackList object representing available audiotracksautoplayItsets/returns whether a video should start playing as soon as it isreadybufferedItreturns a TimeRanges object representing the buffered parts of avideocontrollerItreturns the MediaController object representing the current mediacontroller of a videocontrolsItsets/returns whether a video should have controls displayed(play/pause etc)crossOriginItsets/returns the CORS settings of a videocurrentSrcItreturns the URL of the current videocurrentTimeItsets/returns the current playback position in a video (in seconds)defaultMutedItsets/returns whether the video should be muted by defaultdefaultPlaybackRateItsets/returns whether the default playback ... Read More

HTML DOM Video networkState Property

AmitDiwan
Updated on 18-Feb-2021 05:30:32

75 Views

The HTML DOM Video networkState property returns a number corresponding to the network state of the video.SyntaxFollowing is the syntax −Returning number valuemediaObject.networkStateHere, the return value can be the following −0 (NETWORK_EMPTY) depicts media has not yet been initialized1 (NETWORK_IDLE) depicts media is active and has selected a resource, but is not using the network2 (NETWORK_LOADING) depicts browser is downloading media data3 (NETWORK_NO_SOURCE) depicts no media source foundLet us see an example of HTML DOM Video networkState property −ExampleLive Demo HTML DOM Video networkState    * {       padding: 2px;       margin:5px;   ... Read More

HTML DOM Video muted Property

AmitDiwan
Updated on 18-Feb-2021 05:31:47

164 Views

The HTML DOM Video muted property returns/sets boolean value corresponding to whether the video’s audio will be on mute or not.syntaxFollowing is the syntax −Returning boolean value - true/falsemediaObject.mutedSetting muted to booleanValuemediaObject.muted = booleanValueHere, “booleanValue” can be the following −booleanValueDetailstrueIt defines that video willhave its audio on mutefalseIt defines that video willnot have its audio on muteLet us see an example of Video muted property −ExampleLive Demo HTML DOM Video muted    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 ... Read More

HTML DOM Video loop Property

AmitDiwan
Updated on 18-Feb-2021 05:33:23

92 Views

The HTML DOM Video loop property returns/sets boolean value corresponding to whether the video will play again automatically on end or not.SyntaxFollowing is the syntax −Returning boolean value - true/falsemediaObject.loopSetting loop to booleanValuemediaObject.loop = booleanValueHere, “booleanValue” can be the following −booleanValueDetailstrueIt defines that video willautomatically play again on endfalseIt defines that video won’tautomatically play again on endLet us see an example of Video loop property −ExampleLive Demo HTML DOM Video loop    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 ... Read More

Advertisements