WebRTC audio is not working in lock screen using CallKit - ios

I have tried many solutions from here but no one is working. WebRTC is working fine and I get connected status when accepting the call while the device is locked and after the unlock the audio opens and video starts. How could I get only audio when the screen remains locked?
I have enabled RTCAudioSession and disabled it when the call stops.
It's working fine when the device is unlocked the first time and when I lock it back I'm getting the audio. But the first time, when I answer the call from CallKit, it is not working. It only starts working after the device is unlocked.

I don't know the cause of your specific problem, but what I learnt from similar issue while integrating CallKit with WebRTC, you must acquire camera and microphone access only inside the DidActivateAudioSession method of your implementation of the CXProviderDelegate class. Otherwise, you will get weird issues.

Related

Camera freeze during phone call

I am build a camera module and I noticed a problem during phone calls, my camera is frozen.
I know there are the two notifications AVCaptureSessionWasInterrupted and AVCaptureSessionInterruptionEnded but I'm not quite sure to handle them so the user can still record or take photos even in a phone call.
So far what has worked for me is to remove the audio device when AVCaptureSessionWasInterrupted is called but then the recorded video is frozen when playing it back.
Any tip would be much appreciated.

How youtube is preventing browser to sleep on iPhone?

Environments
iOS 14.4.2 (safari)
chrome 91.4472.80
As I was trying to find a way to prevent my iPhone going to sleep while a browser page is opened, I found 3 ways.
use Screen Wake Lock API
https://developer.mozilla.org/en-US/docs/Web/API/Screen_Wake_Lock_API
call window.location.href periodically and stop it
play a video with a user interaction
For #1, this doesn't work on iPhone, should work on Android.
#2, didn't seem to work on either safari or chrome on iPhone.
#3, also didn't work (even playing a video after user interaction).
I tried https://github.com/richtr/NoSleep.js/ but didn't prevent from sleeping.
I also tried https://github.com/roldanjr/use-stay-awake and it opened a blank video in fullscreen (this maybe fixed by just adding https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#attr-playsinline)
Then, I noticed browser version of Youtube preventing my phone from sleeping while it's playing a video (I set my sleep time for 30 seconds, and it can play a 10 min video without turning itself off).
Does anyone know what kind of technics they are using to do that?

RTCEAGLVideoView orientation change freezes the stream

I inherited an iOS webRTC app from someone else and now i am stuck with a problem for a code i am not familiar with.
It's a pretty generic webRTC video stream inside a Cordova iOS app. The problem im trying to solve is, that the video stream freezes, upon device orientation change. So when I change from lansdscape to portrait, the stream freezes. The app is landscape only, so therefore I would prefer that the video stream never changes orientation in the first place. Question is, how can I prevent a webRTC Videostream to switch orientations.
The app uses the RTCEAGLVideoView class to display the video stream. If anyone has any ideas for me where to even start to prevent that view from switching and therefor freezing, you would save my day.
I would suggest to use RTCCameraPreviewView for your local stream and RTCMTLVideoView for your remote stream.
As you read this post it has fixes for the same:
https://bugs.chromium.org/p/webrtc/issues/detail?id=7442
Also update your GoogleWebRTC SDK in case you are using older version.

Using the TTS Synthesizer in iOS when the app is ALREADY on the background

I would like to play a sound and use the AVSpeechSynthesizer to speak out some strings. The point is that I want these to happen when the device is already locked and then some events happen which triggers them.
I've found lots of info about how to play sound on the background, but this means that playback starts when the app is active and then the playback could continue, if the screen is being locked (after the start of playback). I've done all the tricks but can't hear a sound, which is triggered when the device is locked (and app is already on the background). However this works with iOS 8.3 simulator almost out-of-the-box, but not with a device.
So how to resolve this? Should I actually use some notification stuff to produce the desired outcome? I'm not too familiar with the notifications, so is there any other workarounds or is the notifications way easier than I think?
Cheers,
Mikko

application is crashing while user exits from fullscreen mode in mpmovieplayer

hi folks we do have a video file in our application,every thing is going fine except one,i.e the application crashes when user exits from fullscreen mode while the movie is playing and also when we pause the movie in fullscreen mode and minimize it,the video starts from the beginning i tried searching whether there is any notification available to notify but of no use plz help me out.thx in advance.
atlast after studying a lot about mpmovieplayer class refernece i could find the answer for my question which i had posted yesterday.The reason for that was i was not able to provide all the available notifications i need, now i had mentioned each and every notification for entering into full screen,exit the fullscfreen and also playbackfinished now its working fine.The only problem is when i press the toggle screen it maximizes perfectly and plays from the current playbacktime but that not the case when i minimize the screen the video plays from the begining.

Resources