开发者

How can we play a .m3u8 file in android 2.2 or android 2.3?

How can we play a .m3u8 (m3u file that uses unicode) file in Android开发者_如何学Python 2.2 or 2.3? Is Android capable of playing files in this format?


There is no built-in support in those Android versions for this file format. You may be able to find some third-party JAR that can parse it, though.


I had successfully made m3u8 video partially played on Android 2.3.3 emulator, the problem is the http connection between emulator and server is kind of weak, it drop quite networkpackage quite often, and get "Cannot find sequence number XXX in new playlist" and SocketTimeoutException after a few seconds. I don't have a real device to test but someone said it was the Emulator's fault and should be OK on the real device.

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        String httpLiveUrl = "httplive://your_media_file.m3u8";
        setContentView(R.layout.media_player);
        videoView = (VideoView) findViewById(R.id.myVideoView);
        videoView.setVideoURI(Uri.parse(httpLiveUrl));
        videoView.setMediaController(new MediaController(this));
        videoView.requestFocus();
        videoView.start();
    }


According to here, that file type should be a playlist, a list of mp3 files. You should be able to load the text file (this might help) and show it in a list.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜