Using VideoView for streaming or progressive-download video

前端 未结 3 1676
北荒
北荒 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:46

    It works for simple cases, but only when it is not required to make some custom preparations for requests to get a stream.

    This tutorial shows an example of manual streaming emulation for an audio but it can be a little refactored to play video:

    http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/

    (be sure to use FileDescriptor when setting dataSource, the API was changed slightly from those times).

提交回复
热议问题