Android TV Play Video from URL

ε祈祈猫儿з 提交于 2019-12-10 18:41:36

问题


I would like to play a MP4 video from a URL in my Android TV app.

I couldn't find an example in the Sample code (https://github.com/googlesamples/androidtv-Leanback).

Does anyone know how to do that? Do I need to create my own Activity or is there a standard one in the leanback support library?


回答1:


The androidtv-Leanback example already includes video playback.

If you take a look at the PlaybackOverlayActivity, you will see that the VideoView class is used to play sample videos (you can find the documentation here).

However, there is no standard component in the Leanback support library, so you will have to define an Activity yourself.



来源:https://stackoverflow.com/questions/27891487/android-tv-play-video-from-url

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!