Ant-Media-Server
Ant-Media-Server copied to clipboard
How to play pass music from system while broadcasting in android
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.
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.
Hi @mekya any lead on my query? Please provide a solution as I need this very urgently. Thanks in advance.
Hi @Nishant-Khandelwal25 ,
Thank you for follow up. @SelimEmre could you pelase provide some basic information for that?
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.
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
Hi @Nishant-Khandelwal25,
Please correct me if I'm wrong. You want to add your mp3 music to your stream, right?