How to use android exoplayer

2019-03-09 07:21发布

I am looking to implement Google's ExoPlayer in my app. Their documentation seems pretty vague to me, and all I am looking for is to play a video from an URL, no complicated custom settings or anything like that. Haven't found any tutorials on how to do it. The example they have on git is way too complicated for what I need and, since I am new to video streaming, I did not understand much. All I have managed to do so far is to display a com.google.android.exoplayer.AspectRatioFrameLayout.

Basically, I have an URL. I need to play the video, and handle onConfigurationChanged when the user flips the screen.

Can anyone help?

3条回答
劳资没心,怎么记你
2楼-- · 2019-03-09 07:37

The ExoMedia library wraps exoplayer in simpler api and provides a video view for use in layouts. See usage examples on github: https://github.com/brianwernick/ExoMedia/

查看更多
看我几分像从前
3楼-- · 2019-03-09 07:40

A VideoView would be a better idea in case you wish to display only a Video URL. ExoPlayer requires some developmental effort, even for invoking its simple instance. However, there is an advantage of faster and more efficient playback, backed up by an active open-source community. This link provides a good walk through the implementation giving ample reasons to switch to ExoPlayer. Ofcourse, do checkout the official developer guide, the updated version has split modules for simpler implementation.

查看更多
Melony?
4楼-- · 2019-03-09 07:44

OR

You can see this tutorial video.

https://youtu.be/mVJmOCb8Erw

查看更多
登录 后发表回答