Well, for my purposes, here’s what I did:
Luckily, before the user can trigger the behavior to start audio, they have to click a button. I set the volume of the element to 0.0, and have it “play” when they click this button.
After the sound is played silently, I simply set the volume property back to 1.0, and it plays without user intervention just fine.
Related Contents:
- How to play audio?
- HTML5 record audio to file
- HTML5 audio streaming: precisely measure latency?
- Sound effects in JavaScript / HTML5
- keyCode on android is always 229
- How to detect a long touch pressure with javascript for android and iphone?
- HTML5 Audio Looping
- How to play a video in a webview with android?
- change src with javascript
- HTML5 Audio tag on Safari has a delay
- html5 display audio currentTime
- Position fixed not working in mobile browser
- Invoke native date picker from web-app on iOS/Android
- Disable zoom on input focus in Android webpage
- How can I add multiple sources to an HTML5 audio tag, programmatically?
- Playing html5 audio in android browser
- HTML5 audio playlist – how to play a second audio file after the first has ended?
- Can I prevent phone from sleep on a webpage
- How to prevent form from being submitted?
- What is the difference between properties and attributes in HTML?
- How to decode HTML entities using jQuery?
- Set the value of an input field
- onClick to get the ID of the clicked button
- Populate one dropdown based on selection in another
- Why does this simple JSFiddle not work?
- How to add line breaks to an HTML textarea
- How To Get Font Size in HTML
- Is it possible to alter a CSS stylesheet using JavaScript? (NOT the style of an object, but the stylesheet itself)
- onclick open window and specific size
- Getting binary (base64) data from HTML5 Canvas (readAsBinaryString)
- Best way to detect that HTML5 is not supported
- Positioning element at center of screen
- jQuery: Why use document.ready if external JS at bottom of page?
- How can I disable an in a based on its value in JavaScript?
- How to find the width of a div using vanilla JavaScript?
- Cropping images in the browser BEFORE the upload [closed]
- Add/remove HTML inside div using JavaScript
- Viable options for running NodeJS on Android (Aug 2017)
- How to handle in textarea?
- How do I auto-submit an upload form when a file is selected?
- How to prevent page from reloading after form submit – JQuery
- Webpack file-loader outputs [object Module]
- Original purpose of ? [closed]
- Uncaught TypeError: Cannot read property ‘top’ of undefined
- How to vertically align all text in CSS?
- Can’t get vertical scrollbar with justify-content: flex-end
- How do you float elements without a vertical gap?
- How to execute code after html form reset with jquery?
- Spam Prevention/Reduction – Contact Form?
- How to automatic resize tinyMCE?