html5-audio

How can I change the Audio Source of a Video in HTML?

烂漫一生 提交于 2020-02-06 08:20:06
问题 I want to change the audio track of a video that I am playing in html. This is my sample code. <!DOCTYPE html> <html> <head> <title>Video</title> </head> <body> <video controls playsinline autoplay muted loop> <source src="video.mp4" type="video/mp4"> Your browser does not support the video tag. </video> </body> </html> Inside the same folder, I have an audio.mp3 . I don't want to mute this video and append a hidden player and play both separately, basically I want to change the audio source.

html5 audio mp3 not working in firefox

≯℡__Kan透↙ 提交于 2020-02-03 08:28:07
问题 I have this jsFiddle which works perfectly in Chrome and Safari but does not work in firefox. Sample code: <!DOCTYPE html> <html> <head> <title>Simple Media Player</title> <style> body, div { margin: 0; } </style> </head> <body> <audio preload="auto" controls autoplay> <source src="http://dev-audio-test.s3-website-us-east-1.amazonaws.com/08xCf21_niXjQmGmanVUrR0Tk2h2mKSMw_sxg03CrycaxhNiqhX9_NFYhHBw7eJcp_ru52kdQRW88YigtmTE0w==.mp3" type="audio/mpeg" /> </audio> </body> </html> I have set up a

Get audio duration on Chrome for Android

℡╲_俬逩灬. 提交于 2020-01-29 03:49:09
问题 I'm getting the audio/video duration of a file without appending it to the screen. "Using the same code" , when I try to get the video duration on both sides it works as expected. But when using audio files it says that the duration is 0 on Android, but it works on a desktop computer. // Only working on Desktop var audio = new Audio(url); // Hide audio player // player.appendChild(audio); audio.addEventListener('loadedmetadata', function() { alert(audio.duration); }); And the below code is

Starting audio call only in SImpleWebRTC

南笙酒味 提交于 2020-01-25 19:58:44
问题 I am using This jQuery plugin for WebRtc I want to start audio call only but i can't see any function for this. I am using following code with autoRequestMedia:false :- webrtc = new SimpleWebRTC({ localVideoEl: 'local-videos-container', remoteVideosEl: 'videos-container', autoRequestMedia: false, url: 'https://192.168.1.11:2001/' }); So when user click on audio call i just want to start audio call only not video i can see the method webrtc.startLocalVideo() which start audio and video both.

Insecure “video” over HTTPS

♀尐吖头ヾ 提交于 2020-01-24 23:43:11
问题 I have a site that is loading over HTTPS. I have a HTML5 audio element on that site (currently a fallback for a Flash player), that is loading a Shoutcast URL. The Shoutcast URL is loading using a regular HTTP URL, because it doesn't seem to work using HTTPS. However, Chrome is showing that the page includes elements that aren't secure, and when I check he console, I see this message: Mixed Content: The page at 'https://mysite.com/' was loaded over HTTPS, but requested an insecure video 'http

HTML5 Audio API - “audio resources unavailable for AudioContext construction”

放肆的年华 提交于 2020-01-24 17:14:40
问题 I'm trying to create a graphic equalizer type visualization for HTML5 audio - Chrome only at this point, using webkitAudioContext. I'm finding unusual and unpredictable behaviour when I try to change the source of the audio i.e. to play a different song. I read somewhere I should wait until the "canplay" event on the audio is triggered before connecting it to the context / analyser: var context, sourceNode, analyser, javascriptNode, audio; var ctx = $("#songcanvas").get()[0].getContext("2d");

HTML5 Audio API - “audio resources unavailable for AudioContext construction”

丶灬走出姿态 提交于 2020-01-24 17:14:05
问题 I'm trying to create a graphic equalizer type visualization for HTML5 audio - Chrome only at this point, using webkitAudioContext. I'm finding unusual and unpredictable behaviour when I try to change the source of the audio i.e. to play a different song. I read somewhere I should wait until the "canplay" event on the audio is triggered before connecting it to the context / analyser: var context, sourceNode, analyser, javascriptNode, audio; var ctx = $("#songcanvas").get()[0].getContext("2d");

Why is Firefox ignoring cache control on Range-based queries?

狂风中的少年 提交于 2020-01-24 09:02:13
问题 Web servers have the ability to stream media (audio in this example) to browsers. Browsers use HTML5 controls to play the media. What I'm discovering, however, is that Firefox is caching the media, even though I (believe I) explicitly tell it not to. I have a hunch that it has something to do with the 206 Partial Content response as a regular "non-range" GET with a full 200 OK response does not get cached. Chrome (27) handles this OK, but Firefox (21) does not: HTTP/1.1 206 Partial Content

Playing two files in a row in JavaScript

时光毁灭记忆、已成空白 提交于 2020-01-23 08:39:25
问题 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.

Playing two files in a row in JavaScript

旧时模样 提交于 2020-01-23 08:39:08
问题 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.