HTML Audio/Video Methods:

HTML Audio/Video Methods:

Share It With Your Firends:

HTML 5 <audio> and <video> tags make it simple to add media to a website. You need to set src attribute to identify the media source and include a controls attribute so the user can play and pause the media.

HTML Video:

<!DOCTYPE html> 
<html> 
<body> 

<video width="300" controls>
  <source src="video.mp4" type="video/mp4">
  <source src="video.ogg" type="video/ogg">
  Your browser does not support HTML video.
</video>

<p>
Video courtesy of 
<a href="" target="_blank"></a>.
</p>

</body> 
</html>

The HTML <audio> Element:

<!DOCTYPE html>
<html>
<body>

<audio controls>
  <source src="music.ogg" type="audio/ogg">
  <source src="music.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

</body>
</html>
MethodDescription
addTextTrack()Adds a new text track to the audio/video
canPlayType()Checks if the browser can play the specified audio/video type
load()Re-loads the audio/video element
play()Starts playing the audio/video
pause()Pauses the currently playing audio/video

HTML Audio/Video Properties

PropertyDescription
audioTracksReturns an AudioTrackList object representing available audio tracks
autoplaySets or returns whether the audio/video should start playing as soon as it is loaded
bufferedReturns a TimeRanges object representing the buffered parts of the audio/video
controllerReturns the MediaController object representing the current media controller of the audio/video
controlsSets or returns whether the audio/video should display controls (like play/pause etc.)
crossOriginSets or returns the CORS settings of the audio/video
currentSrcReturns the URL of the current audio/video
currentTimeSets or returns the current playback position in the audio/video (in seconds)
defaultMutedSets or returns whether the audio/video should be muted by default
defaultPlaybackRateSets or returns the default speed of the audio/video playback
durationReturns the length of the current audio/video (in seconds)
endedReturns whether the playback of the audio/video has ended or not
errorReturns a MediaError object representing the error state of the audio/video
loopSets or returns whether the audio/video should start over again when finished
mediaGroupSets or returns the group the audio/video belongs to (used to link multiple audio/video elements)
mutedSets or returns whether the audio/video is muted or not
networkStateReturns the current network state of the audio/video
pausedReturns whether the audio/video is paused or not
playbackRateSets or returns the speed of the audio/video playback
playedReturns a TimeRanges object representing the played parts of the audio/video
preloadSets or returns whether the audio/video should be loaded when the page loads
readyStateReturns the current ready state of the audio/video
seekableReturns a TimeRanges object representing the seekable parts of the audio/video
seekingReturns whether the user is currently seeking in the audio/video
srcSets or returns the current source of the audio/video element
startDateReturns a Date object representing the current time offset
textTracksReturns a TextTrackList object representing the available text tracks
videoTracksReturns a VideoTrackList object representing the available video tracks
volumeSets or returns the volume of the audio/video

Plug-ins

Plug-ins were designed to be used for many different purposes:

  • To run Java applets
  • To run Microsoft ActiveX controls
  • To display Flash movies
  • To display maps
  • To scan for viruses
  • To verify a bank id

YOUTUBE:

<!DOCTYPE html>
<html>
<body>

<iframe width="420" height="345" src="https://youtu.be/my6mdDSlIaY">
</iframe>

</body>
</html>

Share It With Your Friends

Leave a Reply

Recent Posts

  • All Post
  • A.I.
  • AI
  • c
  • c++
  • computer
  • cryptocurrency
  • database
  • digital marketing
  • finance
  • hacking
  • HTML
  • java
  • Marketing
  • network
  • other
  • programming
  • python
  • react
  • social
  • Tools
  • Uncategorized
  • web devlopment
    •   Back
    • drawing In Python
DIY AI Voice Assistant In Python

September 8, 2023

Build your own AI assistant with Python! Learn to recognize voice commands, generate responses, and more. Create your virtual companion…

share it

Recent Posts

  • All Post
  • A.I.
  • AI
  • c
  • c++
  • computer
  • cryptocurrency
  • database
  • digital marketing
  • finance
  • hacking
  • HTML
  • java
  • Marketing
  • network
  • other
  • programming
  • python
  • react
  • social
  • Tools
  • Uncategorized
  • web devlopment
    •   Back
    • drawing In Python

Additional Content

CodeWithAM

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus luctus.

Products

Automated Chatbot

Data Security

Virtual Reality

Communication

Support

Services

FAQ's

Privacy Policy

Terms & Condition

Team

Contact Us

Company

About Us

Services

Features

Our Pricing

Latest News

© 2023 Codewitham