Playing encrypted video files using VideoView

后端 未结 1 538
时光取名叫无心
时光取名叫无心 2020-12-30 13:51

Does android native \"VideoView\" video rendering widget plays encrypted video files?
And if yes then how to play it and what all the APIs.
I have gone through this

相关标签:
1条回答
  • 2020-12-30 14:26

    VideoView can't play an encrypted video, you have to decrypt it yourself. There are roughly two ways:

    1. generate a temporary clear file from the encrypted one, but this has some inconveniences: a delay before to start the playing and an exposure of the contents in clear.
    2. use a streaming scheme, with a local http server.

    libmedia is a library developed to precisely address this feature.

    Something like:

    mServer = new LocalSingleHttpServer();
    mServer.setCipher(myGetCipher());
    mServer.start();
    path = mServer.getURL(path);
    mVideoView.setVideoPath(path);
    mVideoView.start();
    
    0 讨论(0)
提交回复
热议问题