3

In android application I am showing videos using ExoPlayer , I am facing memory issues and slow video rendering, if there is any alternative android native video player please suggest.

Thanks in advance

Aamir
  • 16,329
  • 10
  • 59
  • 65
user3395433
  • 123
  • 2
  • 10
  • Can you please post log or error ? – PriyankaChauhan Dec 29 '16 at 05:17
  • It may help to describe what format are you trying to render (size, bitrate, etc.) and how you are testing - which device & OS version. – Morrison Chang Dec 29 '16 at 05:19
  • i am looking for ExoPlayer alternative or any video player library available on github which support network video streaming – user3395433 Dec 29 '16 at 05:38
  • Please define what `network video streaming` is. As reference here are the native Android supported formats: https://developer.android.com/guide/topics/media/media-formats.html#core You say you are facing memory problem and slow video rendering - in comparison to what - how are you testing. – Morrison Chang Dec 29 '16 at 06:37

2 Answers2

0

You did not specify any special requirements - have you tried MediaPlayer? I had good experience with it.

yakobom
  • 2,681
  • 1
  • 25
  • 33
-1

You can use below code to play .m3u8 file before initializing your exoplayer:-

Handler mHandler = new Handler();

String userAgent = Util.getUserAgent(context, "APPLICATION_NAME");

DataSource.Factory dataSourceFactory = new DefaultHttpDataSourceFactory(
                userAgent, null,
                DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS,
                1800000,
                true);

HlsMediaSource mediaSource = new HlsMediaSource(Uri.parse(mediaUrl),dataSourceFactory, 1800000,mHandler, null);

if (mediaUrl != null) {
    videoPlayer.prepare(mediaSource);
    videoPlayer.setPlayWhenReady(true);
}
Ankit Lathiya
  • 199
  • 1
  • 12