Ant-Media-Server icon indicating copy to clipboard operation
Ant-Media-Server copied to clipboard

How to play pass music from system while broadcasting in android

Open Nishant-Khandelwal25 opened this issue 3 years ago • 6 comments

My app allows user to play music from their android device and let viewers listen to the music at the broadcaster side. I've implemented the music functionality using MediaPlayer class of Android, but the music is not getting registered in the stream as an input.

Any help would be grateful. Thanks.

Nishant-Khandelwal25 avatar Jun 27 '22 04:06 Nishant-Khandelwal25

Thank you for the question @Nishant-Khandelwal25

We've added this functionality in the Android SDK. Let me ask help from my colleague to provide you the instructions.

mekya avatar Jun 27 '22 17:06 mekya

Hi @mekya any lead on my query? Please provide a solution as I need this very urgently. Thanks in advance.

Nishant-Khandelwal25 avatar Jun 29 '22 11:06 Nishant-Khandelwal25

Hi @Nishant-Khandelwal25 ,

Thank you for follow up. @SelimEmre could you pelase provide some basic information for that?

mekya avatar Jul 04 '22 17:07 mekya

Hi @Nishant-Khandelwal25,

You need to use MediaProjection in your environment for using system audio. I have implemented Media Projection in this PR: https://github.com/ant-media/WebRTC-Android-SDK/pull/1/files I hope, it helps you. Please let me know if there is anything that is not clear to you.

SelimEmre avatar Jul 04 '22 21:07 SelimEmre

Hi @SelimEmre ,

Thanks for responding to my query and providing a solution, but my application is using ant media for broadcasting like facebook live and insta live, so my query is, can we pass the music being played in our Android phone to the stream so the viewer can listen it without recording the system audio by MediaProjection

Nishant-Khandelwal25 avatar Jul 05 '22 04:07 Nishant-Khandelwal25

Hi @Nishant-Khandelwal25,

Please correct me if I'm wrong. You want to add your mp3 music to your stream, right?

SelimEmre avatar Jul 18 '22 05:07 SelimEmre