通过A2DP / AVRCP发送跟踪信息 [英] send track informations via A2DP/AVRCP

查看:339
本文介绍了通过A2DP / AVRCP发送跟踪信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过A2DP / AVRCP发送的轨道信息。眼下,音乐是完美的串流播放,但在接收器(即:汽车音响),跟踪信息屏是空白的(这是不使用颇受玩家在那里的情况下)。 你知道吗?

I'm trying to send track informations via A2DP/AVRCP. Right now, music is perfectly streamed, but on the "receiver" (ie: car audio), the "track informations screen" is blank (which is not the case using popular players out there). Any idea ?

推荐答案

这code为我工作:

private static final String AVRCP_PLAYSTATE_CHANGED = "com.android.music.playstatechanged";
private static final String AVRCP_META_CHANGED = "com.android.music.metachanged";

private void bluetoothNotifyChange(String what) {
    Intent i = new Intent(what);
    i.putExtra("id", Long.valueOf(getAudioId()));
    i.putExtra("artist", getArtistName());
    i.putExtra("album",getAlbumName());
    i.putExtra("track", getTrackName());
    i.putExtra("playing", isPlaying());        
    i.putExtra("ListSize", getQueue());
    i.putExtra("duration", duration());
    i.putExtra("position", position());
    sendBroadcast(i);
}

呼叫bluetoothNotifyChange与这取决于您的播放状态相应的意图(如上定义):暂停/播放/元数据更改

Call bluetoothNotifyChange with the appropriate intent (defined above) depending on your playback status: pause/playing/metadata changed.

这篇关于通过A2DP / AVRCP发送跟踪信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆