Using VideoView for streaming or progressive-download video

前端 未结 3 1670
北荒
北荒 2020-11-30 18:22

I\'m confused about how VideoView can be used to play video: from a local file, as progressive download and streaming.

This example work for me (on 1.5 and 2.0 at le

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-30 18:47

    is it possible to play video as progressive download, or by streaming, simply by using setVideoPath or setVideoURI, as in VideoViewDemo in the API samples?

    It should. It certainly works with MediaPlayer, and VideoView is just a ~200 line wrapper around MediaPlayer and a SurfaceView.

    The VideoViewDemo code suggests using setVideoURI for streaming, but I'm not clear what kind of URL I should be using.

    http:// and rtsp:// can work, if the video was encoded properly.

    Does someone have an example URL for a video that can be streamed to the Android emulator using the VideoViewDemo code?

    This video works with MediaPlayer, except on the Nexus One.

    EDIT: Actually, that link works with the Nexus One as well.

提交回复
热议问题