html5-audio

<Audio> fallback through Javascript

纵饮孤独 提交于 2019-12-24 07:39:41
问题 I want to understand how to implement HTML5 <audio> fallback using Javascript... i.e. I have a div on my page, to which , I dynamically append <embed> tag when "Play audio" link is clicked currently.. i.e. I currently use function playSound(audioUrl) { var x = document.getElementById("playAudio"); x.innerHTML = '<EMBED src="'+audioUrl+'" autostart=true loop=false volume=100 hidden=true>'; } I want to have the same thing implemented using the HTML5 <audio> tag, But want to fallback to embed

Angular change detection with HTMLAudioElement

老子叫甜甜 提交于 2019-12-24 07:38:40
问题 I'm trying to build a small audio player but can't seem to get nice change detection, for example for the audio track current time. For example, I have the track playing fine in my component and in my template file I have {{ player.currentTime }} But the time only seems to be updated when I perform other events such as clicking around or play/pause button for example. It doesn't intuitively update live as the track is playing. Seems like issue with change detection or something? For working

Angular ogv.js audio player controls

耗尽温柔 提交于 2019-12-24 07:28:38
问题 I'm using ogv.js in Angular 8. I want to play ogg audio in my browser (Safari). In the browser, just the audio is being played without any controls (play/pause etc.)? My component ts file has: const ogv = require('ogv'); @ViewChild('ogvContainer', { static: true }) ogvContainer: ElementRef; ogv.OGVLoader.base = '../../assets/js/ogv'; let player = new ogv.OGVPlayer(); this.ogvContainer.nativeElement.appendChild(player); let blob = new Blob([new Uint8Array(decodedData)]); player.src = URL

jQuery: On click on native audio element

时光总嘲笑我的痴心妄想 提交于 2019-12-24 05:46:07
问题 How can you detect a click on the native browser's audio element with jQuery? Doesn't seem to work in Chrome. $('audio').click(function(){ alert("You clicked on some audio player"); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <audio preload="none" src="http://webaudioapi.com/samples/audio-tag/chrono.mp3" type="audio/mpeg" controls=""></audio> http://codepen.io/Subfader/pen/GqrmNQ 回答1: You are correct in saying that it doesn't seem to be able to

HTML5 How to replace WebAudio API for Internet Explorer for javascript games?

Deadly 提交于 2019-12-24 03:36:22
问题 I'm new with audio in html. I found some nice examples for little javascript games. Want I try to load the games in Internet Explorer, I got : "Web api audio is not supported in this browser". I found this site : http://caniuse.com/#feat=audio-api and look like Internet Explorer doesn't support it. I found also SoundManager 2 that seem to work on all browsers. My question, is there is a way to detect if the browser support WebApiAudio and offering a fallback if is not supported ? I want to be

Capturing microphone input through HTML5 [closed]

久未见 提交于 2019-12-24 03:29:51
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . If I get it right, this will be achieved through the HTML5 JavaScript API navigator.getUserMedia() in the future. As of this date, what browsers support it? Beta, alpha, build from source.. How can I play around

Display and play audio file selected in input JavaScript

我怕爱的太早我们不能终老 提交于 2019-12-24 03:14:47
问题 I can't find how to play an audio file that the user has just selected with an input. I have the following input : <input type='file' id="audio-input" class="audio-input" name="audio" accept=".mp3, .wav"/> I would like display the audio file when the user select it so he can play it. It would be something like that : ('#audio-input-0').change( function () { let audio = "<audio controls>" + " <source id='audioFile' type='audio/mpeg'>" + " Your browser does not support the audio element." + "<

Access microphone on internet explorer

人走茶凉 提交于 2019-12-24 02:01:17
问题 i do check the WebRTC for checking the existence of microphone, work form chrome to edge but unfortunately ie doesn't support. I found some online websites but non on ie do work correctly. How can i detect if client browser connect with microphone on ie ? 回答1: IE does not support WebRTC and there's no other method on the browser to get a stream from the microphone. Though I haven't tested them, there are plugins to add WebRTC functionality to IE, like Temasys WebRTC plugin or webrtc

Adding play buttons for all audio tags on a page

久未见 提交于 2019-12-24 00:48:52
问题 I want to add a play button for each audio file on a page. Therefore I added a button with an indexed classname under each audio-tag, but now I don't know how to proceed and bind the click event to the buttons. Maybe there's a much more elegant approach in general … <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <audio id="myaudio" src="http://www.soundjay.com//mechanical/gun-cocking-01.mp3"> </audio> <audio id="myaudio" src="http://www.soundjay.com/

Safari - HTML5 audio won't play when tab is in the background

雨燕双飞 提交于 2019-12-24 00:39:15
问题 I have a react app that uses react-sound (basically, HTML5 Audio) to play a sound when a new notification is triggered. I want this sound to play when the tab is backgrounded in Safari, however that does not seem to work. The sound does play when the tab is in the foreground. Does anyone know of a workaround for this? 来源: https://stackoverflow.com/questions/38269953/safari-html5-audio-wont-play-when-tab-is-in-the-background