Jump to content
  • 0

Microphone usage in p2p


TimboE90
 Share

Question

Hey,

we established a p2p connection with AntMedia iOS SDK where only the microphone and camera of one device (sender) should be used. When moving the app in background there is a red indicator on both devices.

How can we disable the usage of microphone (and camera) on receiver / watcher of the p2p connection? Or enable it only for example when the watcher tap/hold a button to speak?

Thanks in advance!
Link to comment
Share on other sites

  • Answers 5
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Posted Images

5 answers to this question

Recommended Posts

  • 0

Hi TimboE90,

Have a good day. You can disable communication when the app skips the background. I'm not an iOS Developer. Here is the iOS app life cycle -> https://medium.com/@ansujain/ios-application-life-cycle-d517a3c44e7e

I think you can call stop() function in applicationWillResignActive state.

We updated our iOS SDK. You can check our iOS SDK Guide -> https://github.com/ant-media/Ant-Media-Server/wiki/WebRTC-iOS-SDK-Guide

Also here is the iOS SDK Reference page -> https://github.com/ant-media/Ant-Media-Server/wiki/WebRTC-iOS-SDK-Reference

I hope, I could help you.

Best Regards,
Selim

 

Link to comment
Share on other sites

  • 0

Hey Selim,

thanks for your answer. We know how to stop the p2p connection but that's not the goal.

The problem is that the microphone is in use even if "audio enabled" is false. To have an example: when having a feature like walkie-talkie / "push button to speak"  the microphone should only be active/used when while the button is pressed. So how to enable / disable the microphone? I think we need an iOS developer of your SDK to clarify this…
Link to comment
Share on other sites

  • 0

Same with the camera…! Easy to see with iOS 14 and your AntMedia iOS Sample app.

When having a p2p connection and disable camera stream the camera is senseless used in background. See screenshot where camera is disabled but the green indicator shows that the app uses the camera… that's wrong!

 

 

IMG_4229.thumb.PNG.55bfefd8b24aaa328b9ef683bc2bdb9b.PNG

Link to comment
Share on other sites

  • 0

Hi,

You need to make a camera&track on/off processes on the fly. Basically, you can see these process examples on switchCamera function that is in AntMediaClientProtocol class. You need to make some development on the SDK side for your requirements.

if you close the camera, you should remove the video track for the change. If you want to open camera, you need to call createVideoTrack function and add a video track to peer connection. 

I hope, it's clear.

Best Regards,
Selim

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share


×
×
  • Create New...