HTTP:// 这样的应该是播不了的。这种要全部下完才能播。注意文档中的说明:http://androidappdocs.appspot.com/guide/topics/media/index.html注意这句话。 Note: If you're passing a URL to an online media file, the file must be capable of progressive download.只能播放流媒体。
If you're passing a URL to an online media file, the file must be capable of progressive download.我也刚刚搞好,播放的文件必须是流媒体,支持顺序读取的 “播放MP4是必须要index 如果index在头部的话,那个这个mp4是支持progressive download的,如果index在尾部,那个这个文件是不支持progressive download的,不同文件也不一样” 师父这样说的Android支持3gp MP4
Note: If you're passing a URL to an online media file, the file must be capable of progressive download.只能播放流媒体。
这个可以看看 我也是无意中找到的
正在看
import android.os.Bundle;
import android.widget.VideoView;public class MyVideoView extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Fill view from resource
setContentView(R.layout.main);
VideoView video = (VideoView) findViewById(R.id.video);
// Load and start the movie
video.setVideoPath("http://www.androidbook.com/akc/filestorage/android/documentfiles/3389/movie.mp4");
//
video.start();
}// @Override
// protected void onCreate(Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// this.setContentView(R.layout.main);
// VideoView videoView = (VideoView) this.findViewById(R.id.video);
// MediaController mc = new MediaController(this);
// videoView.setMediaController(mc);
// videoView.setVideoPath("http://www.androidbook.com/akc/filestorage/android/documentfiles/3389/movie.mp4");
//// videoView
//// .setVideoURI(Uri
//// .parse("http://www.androidbook.com/akc/filestorage/android/documentfiles/3389/movie.mp4"));
// videoView.requestFocus();
// videoView.start();
// }
}
这个是刚才弄的。。
最后得出结论 有些视频文件支持 有些不支持
估计把你的在线视频换成
http://www.androidbook.com/akc/filestorage/android/documentfiles/3389/movie.mp4
也没问题的
progressive download是什么意思啊?
如果LZ HTTP播放不了,可以先查看视频格式尽量采用MP4,3GP格式的视频
“播放MP4是必须要index
如果index在头部的话,那个这个mp4是支持progressive download的,如果index在尾部,那个这个文件是不支持progressive download的,不同文件也不一样” 师父这样说的Android支持3gp MP4
用的也是楼主的程序,模拟器是2.1的
我播:http://www.androidbook.com/akc/filestorage/android/documentfiles/3389/movie.mp4
这个也是卡的,只能看到一张图
不知道咋了?而且播放完了,那个进度条左边的时间还在更新呢!