Flutter Web playing audio not working on iOS 14.6 on both Chrome and Safari - ios

I tried to use both audioplayers and just_audio to play audio from URL and it works on Windows browsers, Android browsers, and iOS 15+ browsers, but not working on iPhone of iOS 14.6.
The used code to play audios with audioplayers:
await audioPlayer.release();
audioPlayer.play(UrlSource(audioURL));
audioPlayer.onPlayerComplete.listen((event) {
audioPlayer.release();
});
Apparently I have read that iPhones used to prevent automatic audio playing and it works only with user interaction but doesn't work if I played the audios automatically without user interaction, I have tried this and this seems to be correct, but I want to play it without user interaction.
so is there a way to prevent this problem in Flutter?

Related

Video is not supported in iOS version

I made applications in react native, Application like Tik-Tok (Users can upload short videos and other users can view these videos all functionality is working well in the android version)
The video is not showing in the iOS version only audio is available,
I notice this video is open in chrome and other browsers except safari browsers,
When I try to play video in the default player of the Mac OS it's not working and when I try with VLC it's working well

WebRTC video chat not working on iOS Safari or iOS Chrome - Is it possible?

I am not technical but have my engineer working on putting together a web-based video chat application with the goal of using it on the iOS web browser(s). The service appears to be functioning correctly on a desktop browser. However, we cannot get it to work on iOS browsers.
on Safari (using iPhone 11 - iOS 13) the video freezes immediately and shows still frame. On Chrome there is never a connection made, nor does Chrome prompt to access camera/mic.
I've read conflicting work that says WebRTC is supported in iOS Safari/Chrome and other work that says it is not.
Would appreciate anyone's help here! Is it possible to create a URL-based video conferencing platform that can correctly function on iPhone?
Try adding 'muted', 'autoplay', 'playsinline' attributes to the Video Element as shown below.
<video muted autoplay playsinline></video>
If you can play it back, it's ok.
From the perspective of the user experience, the browser can autoplay audio or video with audio only on some sites such as Youtube and sites that the user has allowed. It cannot be done on other sites.
To play on sites that can't autoplay, modify it to play with user gestures such as clicks.
video.onclick = _ => video.play();
Here's an example that works from Raspberry Pi to iPhone iOS 13.4
Haven't been able to make it work from Chrome on windows to iPhone
https://apprtc.tc
source code:
https://github.com/webrtc/apprtc
GetUserMedia is not supported in Chrome for iPhone
It is supported in Safari for iPhone
It is supported in Chrome for Windows

How to play react-native-webview audio while the iPhone is muted?

I'm currently running an Expo project with react-native-webview 9.4.0 installed, and I'm trying to use the WebView to play audio from a local .html file with a custom JS script using the Web Audio API. The audio works fine on the iOS simulator and on an iPhone when not on Silent Mode, but once I turn on Silent Mode it's impossible to get any audio to play.
There seems to have been a couple attempts to fix this issue over the past couple months (https://github.com/react-native-community/react-native-webview/pull/1218) and (https://github.com/react-native-community/react-native-webview/issues/1140), but even with the most recent version of react-native-webview I still can't get the Web Audio to play with the iPhone muted. I've tried various workarounds from StackOverflow without any success either. Does anyone else have this issue or have a workaround to suggest?

HTML 5 Video's Audio Muted in iOS 10 Web Apps

Audio in HMTL5 video works fine in Safari on iOS 10.3.1 on iPhone, though it doesn't in standalone web apps (same html code & video file). Video play is fine. Just no sound.
There are a few other related discussions in the past, eg, Why HTML5 video doesn't play in IOS 8 WebApp(webview)?. I tested on iOS 10 using the html provided by that post.
Not sure whether it is a new bug introduced in iOS 10, or a bug that has never been fixed by Apple since earlier versions. Does anyone experience this issue? Are there any workarounds? Thanks in advance.
I had the same question. I googled all over the place. Then I realized what was causing the problem: I had the physical "soft mute" switch (next to the volume buttons) on my iPad turned on. Infuriatingly, this muted the volume on web apps, but not Safari web pages.

Cordova app only playing audio from headphones and not speakers?

I am building an iOS/Android app using Cordova and Ionic and I'm in the unfortunate position where I cannot test on a physical iPad and have to rely on the iOS Simulator for testing. It was just made known to me that this app does not play audio through the speakers when headphones are NOT plugged in, like you would expect, but other Cordova (non-Ionic) apps work fine on both speakers and headphones.
I am on: Cordova v5.1.1, and Ionic v1.0.0-beta.9
I am also using this Cordova plugin for native audio:
de.neofonie.cordova.plugin.nativeaudio 3.1.0 "Cordova Native Audio"
The audio works perfectly fine on my Nexus 7, OS X/Windows browsers, and the iOS Simulator (if there is a way to simulate plugging and unplugging headphones, that would be great but I have not found an option like that).
Here is some code for what I am using for audio:
Preloading one of the files:
//First is the name of the file to play
window.plugins.NativeAudio
.preloadSimple(first, 'audio/' + first + '.mp3', function(msg){}, function(msg) {
console.log('NativeAudio error: ' + msg);
});
Playing the file:
window.plugins.NativeAudio.play(id);
The code above works perfectly fine, it's just that the iPad does not seem to want to play out of the speakers for some reason.
Old question, but I just ran into a similar issue on Ionic 3 with the same plugin and ended up here, so I thought maybe this will help someone at some point.
I have found this plugin to play sounds over the speaker only when the phone's mute switch is off.

Resources