How to play a video from Byte array?

前端 未结 3 1259
时光说笑
时光说笑 2021-02-06 04:17

I am working on an app which needs encryption of video files which is working quite well.But the method I am using to decrypt returns the video as in Byte array. So is there any

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-06 04:46

    After lots of search, this answer could be a sum up. All credits should go the solution owners.

    Since VideoView only accept URL or File, we have two solution;

    Solution 1; Create temp File with stream and provide that file to videoView.

    Ref; https://stackoverflow.com/a/21549067/1847645

    Solution 2; Create media server on Android Local System and provide stream to media server where videoView is directed to the localhost for streaming.

    Ref; https://stackoverflow.com/a/9096241/1847645

    Other Ref; Which is very useful, thanks to libeasy; https://stackoverflow.com/a/15668803/1847645

提交回复
热议问题