简短的回答是否定的。我不认为你可以改变显示的标题来显示服务器上的其他内容。
我相信该播放器是默认的AOSP音乐应用默认的AudioPreview活动。看看它的源代码,显然它会简单地使用URI的最后一个路径段来使用HTTP方案(它只会在本地内容/文件中查询媒体数据库)。
下面是相关的代码片段:
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
// ...
if (scheme.equals(ContentResolver.SCHEME_CONTENT)) {
// ...
} else if (scheme.equals("file")) {
// ...
} else {
// We can't get metadata from the file/stream itself yet, because
// that API is hidden, so instead we display the URI being played
if (mPlayer.isPrepared()) {
setNames();
}
}
}
// ...
public void setNames() {
if (TextUtils.isEmpty(mTextLine1.getText())) {
mTextLine1.setText(mUri.getLastPathSegment());
}
if (TextUtils.isEmpty(mTextLine2.getText())) {
mTextLine2.setVisibility(View.GONE);
} else {
mTextLine2.setVisibility(View.VISIBLE);
}
}
来源
2012-07-28 20:07:43
Joe
谢谢您的确切答案! – Brad 2012-07-28 20:11:25
很高兴帮助!考虑一下,你可能会尝试的一件事是以某种方式配置服务器,以便像'http:// 10.0.37.195/waug_mp3_128k/title_to_display'这样的内容流式传输'http:// 10.0.37.195/waug_mp3_128k'的内容,或者甚至可能只是'http:// 10.0.37.195/title_to_display' :) – Joe 2012-07-28 22:58:09
是的,这是计划。幸运的是,由于我正在构建服务器,因此该部分非常简单。 – Brad 2012-07-28 23:53:39