Table of Contents
Audio and video related properties
Audio and video related events
Home Web Front-end H5 Tutorial Detailed introduction to HTML5 multimedia audio and video (2)

Detailed introduction to HTML5 multimedia audio and video (2)

May 19, 2017 pm 04:55 PM

Earlier we learned the most basic usage of audio and video. In order to control the playback of audio and video more flexibly, we need to learn the related properties, methods and events provided by HTML5.

##srcThe URL address used to specify the media resourceautoplayAuto play after the resource is loadedbuffered Used to return a TimeRanges object to confirm that the browser has cached the media file. controlsProvides control bars for playbackcurrentSrcReturns the URL of media data AddresscurrentTimeGet or set the current playback position in secondsdefaultPlaybackRate Return the default playback speeddurationGet the duration of the current medialoopSet or Return whether to loop playbackmutedSet or return whether to mutenetworkStateReturn to audio video Current network statuspausedCheck if the video is pausedplaybackRateSet or return audio The current playback speed of the videoplayedReturns a TimeRanges object. TimeRanges represents the audio and video range that the user has playedpreloadSet or return whether to automatically load audio and video resourcesreadyState Return the current readiness status of audio and videoseekableReturn the TimeRanges object, indicating that the current media resource can be requestedseekingReturns whether data is being requestedvalumeSet or return the volume, the value is 0 to 1.0
Properties Description
Audio and video related methods

MethodDescriptioncanPlayType()Detect whether the browser can play the specified audio and videoload()Reload Audio and video elementspause()Stop the currently playing audio and videoplay()Start playing the current audio and video
##EventDescriptioncanplay This event occurs when the browser can start playing the specified audio and videocanplaythroughWhen the browser expects to be able to play the specified audio and video without stopping This event occurs when the specified audio and video continues to be played while bufferingdurationchangeThis event occurs when the duration data of audio and video changesloadeddataThis event occurs when the current frame data has been loaded, but there is not enough data to play the next frame of the specified audio videoloadedmatadataThis event occurs when the metadata for the specified audio video has been loaded. Metadata includes duration, dimensions (video only), and text trackloadstartThis event occurs when the browser starts looking for the specified audio videoprogressThis event occurs while downloading the specified audio videoabortWhen the audio video terminates loading , this event occursendedAfter the audio and video playback is completed, this event occurserrorThis event occurs when audio and video loading errorspauseThis event occurs when audio and video are paused playThis event occurs when playback startsplayingThis event is triggered when it is paused due to buffering or is ready after stoppingratechangeThis event occurs when the audio and video playback speed changesseekedThe user has moved or jumped This event occurs when reaching a new position in the audio videoseekingThis event occurs when the user starts to move or jump to a new audio and video playback positionstalledThis event is triggered when the browser attempts to obtain media data, but the data is not availablesuspend This event is triggered when the browser deliberately does not load media datatimeupdateThis event is triggered when the playback position changes volumechangeThis event is triggered when the volume changeswaitingThis event is triggered when the video stops due to buffering
[Related recommendations]

1.

Detailed explanation of the video tag test application of html5

2.

Using video elements in html5 Make a video player

3.

Share the problem and solution of a video tag that cannot play mp4

4.

H5 video tag can only Solution to playback of sound but not video

5.

Solution to IIS MIME not registering the MP4 type, resulting in the inability to recognize the vidoe tag

The above is the detailed content of Detailed introduction to HTML5 multimedia audio and video (2). For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

Klipsch unveils Flexus Core 300 flagship soundbar with 8K support, 12 speakers and room correction Klipsch unveils Flexus Core 300 flagship soundbar with 8K support, 12 speakers and room correction Sep 05, 2024 am 10:16 AM

The Klipsch Flexus Core 300 is the top model in the series and is positioned above the already available Flexus Core 200 in the company's soundbar line-up. According to Klipsch, this is the first soundbar in the world whose sound can be adapted to th

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

HTML Input Placeholder HTML Input Placeholder Sep 04, 2024 pm 04:54 PM

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

See all articles