Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Front End Technology Articles - Page 485 of 860
216 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 −
135 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
278 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
128 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
242 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
141 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
186 Views
The HTML DOM Video load() is used for re-rendering of video element after its certain attributes get updated by user such as ‘src’.SyntaxFollowing is the syntax −videoObject.load()Let us see an example of Video load() property −ExampleLive Demo HTML DOM Video load() * { padding: 2px; margin:5px; } form { width:70%; margin: 0 auto; text-align: center; } input[type="button"] { border-radius: 10px; } ... Read More
145 Views
The HTML DOM Video height property returns/sets a number corresponding to height (in pixels) of media.SyntaxFollowing is the syntax −Returning height as a number (px)mediaObject.heightSetting height to a number (px)mediaObject.height = numberLet us see an example of Video height property −ExampleLive Demo HTML DOM Video height * { padding: 2px; margin:5px; } form { width:70%; margin: 0 auto; text-align: center; } input[type="button"] { border-radius: 10px; } ... Read More
166 Views
The HTML DOM Video ended property returns a boolean (true/false) corresponding to whether the video has reached its end or not.SyntaxFollowing is the syntax −Returning boolean valuemediaObject.endedLet us see an example of HTML DOM Video ended property −Example HTML DOM Video ended * { padding: 2px; margin:5px; } form { width:70%; margin: 0 auto; text-align: center; } input[type="button"] { border-radius: 10px; } ... Read More
217 Views
The HTML DOM Video duration property returns a number corresponding to the length of the video (in seconds).NOTE − For live streams it returns ‘Inf’ which is infinite because live streams have no predefined duration.SyntaxFollowing is the syntax −Returning string valuemediaObject.durationLet us see an example of HTML DOM Video duration property −ExampleLive Demo HTML DOM Video duration * { padding: 2px; margin:5px; } form { width:70%; margin: 0 auto; text-align: center; } input[type="button"] { ... Read More