I have an application that allows users to stream video and audio from their phones using webrtc to the server. The streaming should not be interrupted if the device locks down or the app goes to background. Everything works perfectly in the first case. In the second case, however, when I press the home button, audio still works perfectly but the video freezes. Any help would be much appreciated here.
P.S. I'm using ionic with capacitor.
Related
I am trying to record audio using an app that runs WebView. For example, I load the app in the URL https://online-voice-recorder.com/ and records some audio over the mic. I have given enough permissions and able to record and replay the audio. On Windows 10, it works perfectly. But on my Android Oreo 8.1.0 running Chrom version 80, this audio is fully distorted. I tested it another device and the audio is partially legible.
Is this a standard behavior?
What I have tried to see what is the problem: I wrote a backend netcore3.1 app to play the audio and it plays the same distorted sound.
I have also tried using default sampling rates and custom and in either case, the audio remains distorted.
I made an PhoneGap app that contains an audio player with start / stop.
Player stream audio from shoutcast streaming.
It works perfectly on iOS and it also works on Android, even if the app goes is in background and the phone is lock
but after around 5 minutes audio stops
I tested on OnePlus 6t and has been tested on a Sony Xperia with same results
JS code
myaudio = new Audio(streamurl);
myaudio.id = 'playerMyAdio';
myaudio.play();
All apps without background tasks will get snoozed on Android after a while. You need to set up a background task so your app doesn't go into snooze.
Maybe you can try this plugin
https://github.com/katzer/cordova-plugin-background-mode
I have an AIR Android application which has multiple pages, each page has their own music and sound effects. Music is executed via code and the effects are part timeline and part code executed.
This all works fine on the AIR Simulator but as soon as I run it on a Tablet with Android 4.4.2 it is ok for the first page, but once the first page music and effects sound channels have been faded out (via a volume tween) you wont hear a sound from the application again. Android 4.2.2 however is fine.
I've traced the volumes and the values are fine, I've even tweened the SoundMixer volume itself and still not a sound.
The code is just basic soundmixer and soundtransform code, virtually identical to what is on adobe live docs. I've even skipped the first page and gone directly to the second to see if the sounds are working correctly and they are fine.
Anyone got any suggestions?
Issue was: omni-4.4.2-20140128
Flashed version: omni-4.4.2-20140318
and all is fine in the world once again!
is there any Cordova/Phonegap media plugin available, which can play the audio in background, when screen is locked, particularly for Android. This feature is there by default for iOS, but this doesn't work for Android. I am looking for Cordova/Phonegap media plugin, which works even the screen is turned off for both Android and iOS. Thanks for the help.
A little late but in case anyone needs it.
Phone gap supports audio playing as a built in API. I've had success getting it to work even when the screen is locked. The link to the API page is below:
http://docs.phonegap.com/en/2.3.0/cordova_media_media.md.html
I've decided to try to make a little Android application that streams live audio from my server. I'm using a HTML5 audio tag for the audio. But, on some devices when the user goes to the browser or their messages the music stops playing. Would I need to create an ongoing notification so the audio would continue to play? Or, would something else be better? I'm using PhoneGap too, I don't know if there's a plug-in out there that I've missed that could solve this. I'm trying to learn all of this on my own, but I'm just confused at this point.
I think it ended up being a problem with the app manager just closing the app.