Join Regular Classroom : Visit ClassroomTech

HTML – codewindow.in

Related Topics

HTML

Introduction
Html page 1
Html page 2
Html page3
Html page4

HTML Elements and structure
Html page 5
Html page 6
Html page 7

HTML Headings and Paragraphs
Html page 8
Html page 9
Html page 10

HTML Lists and Tables
Html page 11
Html page 12
Html page 13

HTML Forms and Input Fields
Html page 14
Html page 15
Html page 16

HTML Images and Media
Html page 17
Html page 18

HTML Links and Anchors
Html page 19
Html page 20
Html page 21

HTML Styles and Formatting
Html page 22

HTML Semantic Elements
Html page 23
Html page 24

HTML Attributes
Html page 25
Html page 26

HTML JavaScript Integration
Html page 27
Html page 28
Html page 29
Html page 30

HTML Document and Browser Support
Html page 31
Html page 32

HTML5 New Elements and Attributes
Html page 33
Html page 34
Html page 35
Html page 36

HTML Accessibility and Web Standards
Html page 37
Html page 38
Html page 39

HTML Responsive Design and Mobile Devices.
Html page 40
Html page 41
Html page 42

CSS

Introduction
CSS Page 1
CSS Page 2
CSS Page 3
CSS Page 4

CSS Selectors and the Box Model
CSS Page 5
CSS Page 6
CSS Page 7

CSS Layout and Display Properties
CSS Page 8
CSS Page 9
CSS Page 10
CSS Page 11

CSS Text and Font Properties
CSS Page 12
CSS Page 13
CSS Page 14
CSS Page 15

CSS Backgrounds and Borders
CSS Page 16
CSS Page 17
CSS Page 18
CSS Page 19
CSS Page 20

CSS Colors and Transparency
CSS Page 21
CSS Page 22
CSS Page 23
CSS Page 24

CSS Gradients and Shadows
CSS Page 25
CSS Page 26

CSS Transformations and Animations
CSS Page 27
CSS Page 28
CSS Page 29

CSS Flexbox and Grid Layout
CSS Page 30
CSS Page 31
CSS Page 32

CSS Media Queries and Responsive Design

CSS Page 33
CSS Page 34
CSS Page 35

CSS Transitions and Transforms
CSS Page 36
CSS Page 37
CSS Page 38

CSS Preprocessors (Sass, Less, etc.)
CSS Page 39
CSS Page 40
CSS Page 41

CSS Best Practices and Debugging Techniques.
CSS Page 42
CSS Page 43
CSS Page 44

HTML

<figure>
  <img src="image.jpg" alt="Description of the image">
  <figcaption>Caption for the image</figcaption>
</figure>

In the above code, the <figure> tag groups the <img> tag, which displays the image, with the <figcaption> tag, which provides a caption for the image.

By using the <figure> and <figcaption> tags, you can provide additional context and information for media content in your HTML page, making it easier for users to understand and engage with your content.

<audio id="myAudio" src="myAudio.mp3"></audio>
<button>Play Audio</button>
<button>Pause Audio</button>

  var audio = document.getElementById("myAudio");
  function playAudio() {
    audio.play();
  }
  function pauseAudio() {
    audio.pause();
  }

In the above example, we have an audio element with an id of “myAudio” and two buttons with onclick events that call the playAudio() and pauseAudio() functions respectively. Inside the JavaScript code, we get a reference to the audio element using the getElementById() method and call the play() and pause() methods to play and pause the audio respectively.

  1. Change Playback Speed:

You can change the playback speed of audio or video using the playbackRate property of the Media API. Here’s an example:

<video></video>
<button>Change Speed</button>

  var video = document.getElementById("myVideo");
  function changeSpeed() {
    video.playbackRate = 2.0;
  }

In the above example, we have a video element with an id of “myVideo” and a button with an onclick event that calls the changeSpeed() function. Inside the JavaScript code, we get a reference to the video element using the getElementById() method and set the playbackRate property to 2.0 to change the playback speed.

  1. Seek to a Specific Time:

You can seek to a specific time in the audio or video using the currentTime property of the Media API. Here’s an example:

<video></video>
<button>Seek To 10 seconds</button>

  var video = document.getElementById("myVideo");
  function seekTo() {
    video.currentTime = 10;
  }

In the above example, we have a video element with an id of “myVideo” and a button with an onclick event that calls the seekTo() function. Inside the JavaScript code, we get a reference to the video element using the getElementById() method and set the currentTime property to 10 to seek to 10 seconds.

These are just a few examples of how to control audio and video playback using JavaScript and HTML. The Media API provides many more methods and events for controlling media playback, such as adjusting the volume and handling media events like “ended” and “timeupdate”.

<video width="640" height="360"></video>

In this example, we have a <video> tag with a “src” attribute that specifies the URL of the video file to be played. We also have “width” and “height” attributes that set the dimensions of the player, a “controls” attribute that displays the default set of controls, and a “poster” attribute that displays an image while the video is loading.

Similar attributes can also be used with the <audio> tag. These attributes allow you to customize the appearance and behavior of the media player, providing a better user experience for your visitors.

<video>
  <track kind="subtitles" src="mySubtitles.vtt" srclang="en" label="English subtitles">
</video>

In this example, we have a <video> element with a “src” attribute that specifies the URL of the video file to be played. We also have a <track> element inside the <video> element, with a “src” attribute that specifies the URL of the subtitles file. The “kind” attribute is set to “subtitles”, indicating that this is a text track for subtitles. The “srclang” attribute is set to “en”, indicating that this is an English-language text track. Finally, the “label” attribute is set to “English subtitles”, which will be displayed to the user in the media player.

You can also add multiple <track> elements to support multiple languages or types of text tracks, such as captions or descriptions. Once you’ve added the <track> elements, the media player should automatically detect and display the appropriate text track based on the user’s preferences or the default language settings of the page.

      

Popular Category

Topics for You

CSS

Introduction
CSS Page 1
CSS Page 2
CSS Page 3
CSS Page 4

CSS Selectors and the Box Model
CSS Page 5
CSS Page 6
CSS Page 7

CSS Layout and Display Properties
CSS Page 8
CSS Page 9
CSS Page 10
CSS Page 11

CSS Text and Font Properties
CSS Page 12
CSS Page 13
CSS Page 14
CSS Page 15

CSS Backgrounds and Borders
CSS Page 16
CSS Page 17
CSS Page 18
CSS Page 19
CSS Page 20

CSS Colors and Transparency
CSS Page 21
CSS Page 22
CSS Page 23
CSS Page 24

CSS Gradients and Shadows
CSS Page 25
CSS Page 26

CSS Transformations and Animations
CSS Page 27
CSS Page 28
CSS Page 29

CSS Flexbox and Grid Layout
CSS Page 30
CSS Page 31
CSS Page 32

CSS Media Queries and Responsive Design

CSS Page 33
CSS Page 34
CSS Page 35

CSS Transitions and Transforms
CSS Page 36
CSS Page 37
CSS Page 38

CSS Preprocessors (Sass, Less, etc.)
CSS Page 39
CSS Page 40
CSS Page 41

CSS Best Practices and Debugging Techniques.
CSS Page 42
CSS Page 43
CSS Page 44

Go through our study material. Your Job is awaiting.

Recent Posts
Categories