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


    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)


    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


    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


    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


    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


    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 […]