Skip to content Skip to sidebar Skip to footer

How To Play M3u8 On Android?

As i understood, Android 3.0 and above are able for play radio streaming m3u8 - http://developer.android.com/guide/appendix/media-formats.html I put this link - http://content.mobi

Solution 1:

Following this link trail: http://code.google.com/p/android/issues/detail?id=14646

->

http://code.google.com/p/android/issues/detail?id=16884

->

http://code.google.com/p/android/issues/detail?id=17118

(ARGGGGH!)

Gives the answer in the end:

basically in Android v2.3 & v3.0, use the non-standard httplive:// scheme, in 3.1 use http:// but with some code workaround in how you call the relevant methods in the media framework.

Solution 2:

Try ExoMedia, streaming is as easy as:

emVideoView.setVideoURI(Uri.parse("https://archive.org/download/Popeye_forPresident/Popeye_forPresident_512kb.mp4"));

I works well with m3u8.

Solution 3:

Maybe you can try the Vitamio plugin, http://vov.io/vitamio/

Vitamio is a multimedia framework for all Android devices. Vitamio works like the Android's default MediaPlayer except that it includes much more powerful features. And it's absolutely free ! Network Protocols

The following network protocols are supported for audio and video playback:

MMS
RTSP(RTP, SDP)
HTTP progressive streaming
HTTP live streaming(M3U8), for Android 2.1+

Solution 4:

This is my example of how to play .M3U8 Streaming in Android

activity_main.xml

<?xml version="1.0" encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:layout_height="wrap_content"android:orientation="vertical" ><VideoViewandroid:id="@+id/myVideoView"android:layout_width="fill_parent"android:layout_height="wrap_content" /></LinearLayout>

Main.java

package com.grexample.ooyalalive;

import java.net.URL;
import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;

publicclassMainextendsActivity {

    private String urlStream;
    private VideoView myVideoView;
    private URL url;

    @OverrideprotectedvoidonCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_vv);//***************
            myVideoView = (VideoView)this.findViewById(R.id.myVideoView);
            MediaControllermc=newMediaController(this);
            myVideoView.setMediaController(mc);         
            urlStream = "http://jorgesys.net/i/irina_delivery@117489/master.m3u8";
            runOnUiThread(newRunnable() {
                @Overridepublicvoidrun() {
                    myVideoView.setVideoURI(Uri.parse(urlStream)); 
                }
            });
    }
}

I have seen a lot of people have problems playing .M3U8, it depends on the codecs used for the streaming and compatibility with the device, for example some of my .m3u8 files are only supported in devices with screens of 1200 x800 and higher.

Solution 5:

You can use FFmpegMediaPlayer:

https://github.com/wseemann/FFmpegMediaPlayer

Post a Comment for "How To Play M3u8 On Android?"