Tag:audio

  • The HTML5 audio tag uses JS for playback control instances

    Time:2022-1-9

    The < audio > tag can play audio files in an HTML5 browser. < audio > provides a control panel by default, but sometimes we only need to play sound. The display status of the control panel is defined by ourselves. Here we can use js for control. The code is as follows: Copy code […]

  • Solution to the problem that audio auto playback is not supported in IOS system and wechat

    Time:2021-12-21

    preface Recently, I’m working on a mobile terminal project. I need to configure a background music for H5 and play it automatically. Just add the automatic playback code according to the previous method, but there’s a little episode (covering my face). I won’t say much below. Let’s take a look at the detailed introduction together. […]

  • This paper briefly introduces the use of audio tag in HTML5

    Time:2021-11-27

    In the HTML5 standard web page, we can use the audio tag to call and play the sound. The following are the three basic formats most commonly seen using HTML5: 1. Minimum code Copy code The code is as follows: <audio src=”song.ogg” controls=”controls”></audio> 2. Code with incompatibility reminder Copy code The code is as follows: […]

  • Modification of HTML5 audio label style

    Time:2021-10-28

    Let’s introduce the new element tags in HTML5SRC: audio file path.Autobuffer: sets whether to automatically buffer audio when the page is loaded.Autoplay: set whether the audio is played automatically.Loop: sets whether the audio should be played in a loop.Controls: property for adding playback, pause, and volume controls.Due to the popularity of HTML5, audio can be […]

  • The basic method of embedding audio and video playback in web pages using HTML5

    Time:2021-9-5

    HTML5 features, including native audio and video support without flash. HTML5 < audio > and < video > tags make it easy to add media to the site. We only need to set the SRC attribute to identify media resources, including the controls attribute, so that users can play and pause media. Embedded videoThe following […]

  • On H5 custom audio (problems and solutions)

    Time:2021-3-19

    H5 activities need to insert audio, but also need to customize the style, so write your own html XML/HTML CodeCopy content to clipboard <! — cur represents the current time, Max represents the total time, and input represents the progress bar — >   <span class=‘cur’></span><input type=“range” min=0 max=100 class=‘range’ value=0><span class=‘max’></span>   css CSS CodeCopy content to clipboard /*Progress bar*/   .range {        width: 5.875rem; […]

  • Solve the problem that IOS audio cannot play

    Time:2021-1-15

    In IOS, audio can’t pass through directly audio.play () to play, the user needs to execute it in the click event or touch event audio.play () to play. Ajax callback audio.play () the music doesn’t play properly. The user clicks the button and plays the corresponding successful or failed music after the server returns the […]

  • Quickly solve the problem that audio cannot play automatically under IOS wechat

    Time:2020-4-14

    As we all know, Safari under IOS can’t play music automatically, and it’s useless to take the initiative to start clicking events, Wechat can solve the problem with the following methods document.addEventListener(“WeixinJSBridgeReady”, function () { audio.play(); }, false); But now it can be called directly when wechat is ready wx.ready(function() { audio.play(); }); The above […]

  • Solve the problem that audio in HTML5 can’t play automatically on mobile phone and wechat

    Time:2020-1-16

    When doing the H5 page again, I found that audio can’t play automatically after autoplay is added to the mobile phone and wechat. This is because the mobile phone is set to save vagrancy The usual solution is to give an interactive event: Label: <audio loop src=”/photo/aa.mp3″ id=”audio” autoplay preload=”auto”> The browser does not support […]

  • Solution of Audio Format Supported by Audito in HTML 5

    Time:2019-5-15

    HTML5 Audio tags can support wav, mp3, ogg, acc, WebM and other formats, but a very important music file format MIDI (extension mid) has no built-in support in major browsers. Not all browsers support MP3 OGG and so on. Each browser supports different formats because of copyright issues. Browser and Audio Compatibility Not all browser […]