Download video along with playing

后端 未结 2 1541
一向
一向 2020-12-13 21:58

I want to implement online video playing functionality along with downloading it. I mean same download stream should be used to download and play so that video can be saved

2条回答
  •  一生所求
    2020-12-13 22:24

    You can create local proxy that will save the stream.

    Create two background threads: download thread and streaming thread.

    In the streaming thread create ServerSocket and stream data that are just being downloaded.

    In the VideoView open the localhost url of your ServerSocket.

    You will need to handle buffering, synchronizing threads etc.

提交回复
热议问题