gpt4 book ai didi

Android 浏览器媒体播放器(stagefright?)显示的媒体名称

转载 作者:太空狗 更新时间:2023-10-29 14:26:50 26 4
gpt4 key购买 nike

当 Android 浏览器打开它可以播放的媒体文件时,内置的(stagefright?)媒体播放器会打开并播放它。该媒体的标题根据 URL 显示在播放器对话框中。

Android Media Player, with title highlighted

本例中的 URL 是 http://10.0.37.195/waug_mp3_128k。媒体播放器仅使用路径的最后一部分作为其标题。

是否可以更改显示的标题?

我试过 Content-Disposition header ,但没有效果:

Content-Disposition: inline; filename=Some Better Title

最佳答案

简短的回答是否定的。我不认为您可以更改显示的标题以显示来自服务器的其他内容。

我相信播放器是默认的AudioPreview来自默认 AOSP 音乐应用程序的 Activity 。查看它的源代码,显然它会简单地使用 URI 的最后一个路径段用于使用 HTTP 方案的流(它只会查询媒体数据库以获取本地内容/文件)。

以下是相关的代码 fragment :

@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);
}
}

关于Android 浏览器媒体播放器(stagefright?)显示的媒体名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11602523/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com