简体   繁体   English

在我的应用内控制其他应用的音乐

[英]Control music of other apps within my app

I'm currenty trying to find out if it's possible to control the music of other apps, eg Spotify, within my app.我目前正在尝试了解是否可以在我的应用程序中控制其他应用程序(例如 Spotify)的音乐。 The two solutions I found are:我找到的两个解决方案是:

  • using the SDK of the specific service (eg Spotify SDK)使用特定服务的 SDK(例如 Spotify SDK)
  • take over the audio session in my app, but this only allows me to stop/ play the music接管我的应用程序中的音频会话,但这仅允许我停止/播放音乐

I'm trying to find a solution that provides me with pause, play, forward, backward control and access to the title, maybe also the cover.我试图找到一种解决方案,为我提供暂停、播放、前进、后退控制和访问标题,也许还有封面。 Then I came across the "Sony Headphones Connect" app.然后我遇到了“Sony Headphones Connect”应用程序。 It has a page with media control buttons, the title of the current song and is does not require any kind of sing in to Spotify or something else.它有一个带有媒体控制按钮的页面,当前歌曲的标题,并且不需要任何类型的 Spotify 或其他东西。

在此处输入图片说明

Picture is from the app from the App Store, I tested the controls and they work.图片来自 App Store 的应用程序,我测试了控件并且它们可以工作。

So somehow it must be possible, does anyone have an idea how I can achieve my desired result or how the "Sony Headphones Connect" app is handling this issue?所以不知何故它必须是可能的,有没有人知道我如何达到我想要的结果或者“Sony Headphones Connect”应用程序如何处理这个问题?

I think I found the answer, the "Sony Headphones Connect" app is controlling the music over bluetooth.我想我找到了答案,“Sony Headphones Connect”应用程序正在通过蓝牙控制音乐。 So it's not directly possible to control the music of another app.所以不能直接控制另一个应用程序的音乐。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM