我正在尝试在Android应用程序上实现MediaPlayer,但现在我有两个问题,这些问题不是很大,但它们更令人烦恼,我必须解决它,只为我而已.
我为一个Activity实现了一个异步MediaPlayer + Controller,工作正常.我的计划是显示MediaControl上缓冲的百分比.这也有效.
但是现在,在我看到百分比后,我看到了一个奇怪的行为:如果我寻找已经在缓冲区中的位置,缓冲将再次从这个位置开始.这是一个已知和/或正常的行为/问题/功能吗?
这里有更多细节:
我正在使用2.2 SDK这是我实现它的方式
public class Details extends Activity implements MediaPlayer.OnPreparedListener, MediaController.MediaPlayerControl {
[...]
private void setPosition(int currentPos ){
position = currentPos;
}
[...]
public void onCreate(Bundle savedInstanceState) {
[...]
mediaPlayer.setOnBufferingUpdateListener(new MediaPlayer.OnBufferingUpdateListener() {
@Override
public void onBufferingUpdate(MediaPlayer mp, int progress) {
setPosition(progress);
}
});
[...]
public int getBufferPercentage() {
return position;
}
[...]
public void seekTo(int i) {
General.mediaPlayer.seekTo(i);
}
}
Run Code Online (Sandbox Code Playgroud)

点击搜索栏后我的预期

我得到了什么

这是正常的吗?
目前我在centOS7上运行nginx/1.6.3网站
除了一些重定向外,一切都运行顺畅.
这是我的.conf文件的样子:
server {
listen 443 ssl spdy default deferred;
server_name .example.com;
... more configs
}
server {
listen 80;
server_name .example.com;
return 301 https://example.com$request_uri;
}
Run Code Online (Sandbox Code Playgroud)
我想要完成的是以下场景:
user visits in browser | this should happen
------------------------------------|-------------------------------------
https://example.com$request_uri | Just deliver content
https://*.example.com$request_uri | 301 https://example.com$request_uri
https://123.123.123.123$request_uri | 301 https://example.com$request_uri
http://example.com$request_uri | 301 https://example.com$request_uri
http://*.example.com$request_uri | 301 https://example.com$request_uri
http://123.123.123.123$request_uri | 301 https://example.com$request_uri
Run Code Online (Sandbox Code Playgroud) 有没有办法在我的应用程序中实现以下功能?应该有一个类似行为的Gridview,但具有不同的行高.还是有另一个wigdet,提供这样的功能?(适配器,n列等)我花了最近3天尝试和捕捉,但我没有得到任何匹配的解决方案
