rajeswari
rajeswari

Reputation: 187

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 2.2 or 2.3? Is Android capable of playing files in this format?

Upvotes: 4

Views: 4558

Answers (3)

yorkw
yorkw

Reputation: 41126

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

Upvotes: 1

NoBugs
NoBugs

Reputation: 9512

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.

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1007584

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.

Upvotes: 2

Related Questions