Gramophone icon indicating copy to clipboard operation
Gramophone copied to clipboard

Feat: Add media output switcher support for original equipment manufacturers (OEMs)

Open ghhccghk opened this issue 4 months ago • 9 comments

Code sources: https://github.com/Moriafly/media-kit and https://github.com/Yos-X/FlamingoSank

The functionality works as follows across different Android versions and OEM ROMs:

  • For Android 14 and higher, it uses MediaRouter2#showSystemOutputSwitcher.
  • For Android 12 and higher, it uses the “com.android.systemui.action.LAUNCH_MEDIA_OUTPUT_DIALOG” action.
  • For Android 11, it uses the “com.android.settings.panel.action.MEDIA_OUTPUT” action.
  • For MIUI (Xiaomi), it uses “miui.systemui.miplay.MiPlayDetailActivity”.
  • For One UI (Samsung), it uses “com.samsung.android.mdx.quickboard.view.MediaActivity”.

ghhccghk avatar Aug 08 '25 13:08 ghhccghk

If you have any more questions, let's talk about them tomorrow. I'm going to bed now.

ghhccghk avatar Aug 09 '25 15:08 ghhccghk

@ghhccghk

Can you please:

  • move the output switcher button to the top right like you mentioned before
  • use .xml icon for output switcher instead of .png
  • remove xiaomi and samsung specific code for now, because it'll get stale and there's no way for me to know when xiaomi or samsung update their apis
  • use "git rebase" to update your pr branch on top of latest gramophone

thank you!

nift4 avatar Aug 15 '25 21:08 nift4

@ghhccghk

Can you please:

  • move the output switcher button to the top right like you mentioned before
  • use .xml icon for output switcher instead of .png
  • remove xiaomi and samsung specific code for now, because it'll get stale and there's no way for me to know when xiaomi or samsung update their apis
  • use "git rebase" to update your pr branch on top of latest gramophone

thank you!

OK, I have confirmed that Xiaomi will not remove the api, because this is one of their important interfaces for interconnection.

ghhccghk avatar Aug 15 '25 23:08 ghhccghk

So, the current problem is that it will show button for old device which never had output switcher. Like Android 5, 6, 7, 8, etc.

nift4 avatar Aug 27 '25 12:08 nift4

So, the current problem is that it will show button for old device which never had output switcher. Like Android 5, 6, 7, 8, etc.

Then add detection, and hide it if it is not supported

ghhccghk avatar Aug 27 '25 17:08 ghhccghk

Sure, I'll do it soon.

nift4 avatar Aug 27 '25 17:08 nift4

Sure, I'll do it soon.

OK

ghhccghk avatar Aug 27 '25 17:08 ghhccghk

Hi, just to clarify what's the status: I think I will merge this after next release when I have more time. Reason is that 1. this is good opportunity to move more buttons around and migrate to proper TopAppBar in that screen, 2. as fallback I want to implement in-app output switcher (for A10 and earlier), 3. I want to check if it's possible to make MediaRouter allow to change between headphones and speaker before A15 in this output switcher, 4. for the previous point it would be good if Google fixed https://issuetracker.google.com/issues/340805981

Basically I want to check how much potential MediaRouter has before merging this feature, but I promise I will get back to you. Thank you for your patience!

nift4 avatar Oct 28 '25 20:10 nift4

Hi, just to clarify what's the status: I think I will merge this after next release when I have more time. Reason is that 1. this is good opportunity to move more buttons around and migrate to proper TopAppBar in that screen, 2. as fallback I want to implement in-app output switcher (for A10 and earlier), 3. I want to check if it's possible to make MediaRouter allow to change between headphones and speaker before A15 in this output switcher, 4. for the previous point it would be good if Google fixed https://issuetracker.google.com/issues/340805981

Basically I want to check how much potential MediaRouter has before merging this feature, but I promise I will get back to you. Thank you for your patience!

no problem

ghhccghk avatar Oct 29 '25 00:10 ghhccghk