html5-audio

Remove max-width on audio player in Chrome

好久不见. 提交于 2019-12-06 00:23:01
I'd like the default HTML5 audio player to fit the width of its parent container. I set its display to 'block' and width to '100%'. However, it seems like Chrome starts to add padding on the left and right sides after surpassing a certain window size: Firefox is behaving as I'd like it to, with the edges of the player reaching exactly to the edge of the parent div: How can I remove this extra padding in Chrome?? EDIT:: As pointed out in the comments, it looks like it's actually a max-width (not padding)... Thanks! There is a max-width: 800px in the shadow DOM: You can use ::-webkit-media

Streaming MP3: iOS restarts HTML5 audio after 2 minutes

别说谁变了你拦得住时间么 提交于 2019-12-05 20:53:56
I'm trying to stream an mp3 file and play it via HTML5 audio tag. After about 2 minutes, iOS starts playing the audio from the start. I tested this on Safari @ iOS 11.4. Below is simplified code: File: index.html <!DOCTYPE html> <html> <body> <audio controls><source src="audio.php" type="audio/mpeg"></audio> </body> </html> File: audio.php header('Content-Type: audio/mpeg'); header('Content-Disposition: inline; filename="audio.mp3"'); header('X-Pad: avoid browser bug'); header('Cache-Control: no-cache'); readfile('audio.mp3'); Audio works if I use audio.mp3 file directly Everything works well

variable speed control for audio playback in the browser?

≯℡__Kan透↙ 提交于 2019-12-05 19:40:37
Is there a way to change the playback speed of audio in the browser? What is best to accomplish this task, html5 audio, or flash, or something else? Are there any specific libraries that would help with this? William Use the Web Audio API. In the following code I answered your other question. best way to loop audio in the browser? Modify the code in my answer above as follows for a playback speed example. Right below source.loop = loopOnOff; add source.playbackRate.value = 1; // change number to between 0.10 to 10 (or larger/smaller) to test. You can also run the html audio tag through the web

Playing two files in a row in JavaScript

こ雲淡風輕ζ 提交于 2019-12-05 17:39:32
I can't get this right. So, I'm making a simple script that tells the current time. audiocontainer is an audio element, and the mp3play() function has been defned earlier. The idea is to do that: [play hourXX.mp3] -> when it ends -> [play minutesXX.mp3] -> delete listener, therefore stop. The problem is: Without the removeEventListener() function, the minuteXX.mp3 loops indefinitely ("It's 12 and 54 minutes... 54 minutes... 54 minutes...) because it keeps triggering the listener at the end. With the removeEventListener() function the audio doesn't start at all. Do you have any idea why? Or

Continuous HTML5 audio/video playback in iOS?

本小妞迷上赌 提交于 2019-12-05 16:53:07
I'm working on a mobile web app and want to allow for continuous playback of HTML5 audio or video in both Android and iOS (i.e. queue up a playlist of YouTube videos or Grooveshark songs and have them all play in a row automatically). Android doesn't seem to be an issue, but everything I've read has suggested that Safari prevents audio from playing unless it's initiated by a user, and prevents continuous play if the screen becomes locked. That said, Grooveshark's mobile web app will play an entire playlist of songs in my iPhone 5 (iOS 7). It'll play the next song even if I'm in another Safari

Why does HTML 5 Audio disregards mobile device audio settings such as silent or volume?

Deadly 提交于 2019-12-05 16:45:59
问题 I have a site that targets mobile android users. I’m using the HTML5 audio to play background music. The audio is played even if the device is on silent; also the audio is played in the highest volume regardless of the device volume settings. Does anyone know why these things happen or how to get the device current audio settings? I’d prefer a client side (javascript) solution but I’m open to all solution. Thank you for your help Moshe S. 回答1: In Android, even if the phone is on silent, the

Open stream_url of a Soundcloud Track via Client-Side XHR?

 ̄綄美尐妖づ 提交于 2019-12-05 16:22:33
Since you can call the the Soundcloud API via XHR (because of the CORS headers it sends http://backstage.soundcloud.com/2010/08/of-cors-we-do/ , right?) I was wondering if this was possible with the audio data itself, like a tracks' stream_url for example. When trying to open the stream_url with a XHR (from the Client Side) using the Web Audio API, i get a Origin is not allowed by Access-Control-Allow-Origin. error. Is there a way to load Audio resources via XHttpRequest from Client-Side-Javascript, or is it impossible ( https://stackoverflow.com/questions/10871882/audio-data-api-and-streaming

How to synthesize audio using HTML5/Javascript on iPad

一个人想着一个人 提交于 2019-12-05 12:36:54
Has anybody out there got working sample code that synthesizes (and plays) audio using HTML5/Javascript on Mobile Safari on the iPad? I have found some examples for javascript-based sound synthesis on the web, but they all seem to work in Firefox only. Recently I came across this js-library, I think this is what you want -> https://github.com/oampo/Audiolet Here is an example that works for me on an iPad: www.cse.usf.edu/~turnerr/sound_demo.html You can download the files from http://www.cse.usf.edu/~turnerr/Downloads/Sound_Demo.zip This demo is on a Unix based server. But I have not been been

JavaScript / HTML5 audio: play mp3 file loaded by user via file selector in Android Chrome

邮差的信 提交于 2019-12-05 11:53:57
I am trying to create a site where user can select a local audio file from their PC or tablet and (without uploading the file to the server) play that file using HTML5 audio tag (user is supposed to click the button to play it, autoplay feature is not needed). I am not able to achieve this in Android version of Chrome despite the fact that this browser should support everything that is needed. In desktop version of Chrome it works. I have tried different methods how to load that file: via JavaScript FileReader - you can fiddle with it here: http://liveweave.com/2kOWoz function handleFileSelect