嗨,我正在开发电子家教应用程序使用颤音,所以视频必须加密,所以我加密了所有的视频,我如何才能在我的应用程序只在离线模式下,从我的SD卡,我使用了路径提供商?
发布于 2022-05-25 12:03:12
使用加密包,您可以以所需格式加密或解密文件。看看,也许会有帮助的。
发布于 2022-11-16 05:40:50
本机系外播放器支持播放加密文件。这也适合您不解密外部存储中的文件以防止访问的要求。
来自上述参考的代码示例:
val player = SimpleExoPlayer.Builder(this).build()
playerView.player = player
// This is the MediaSource representing the media to be played.
val dataSourceFactory: DataSource.Factory = DefaultDataSourceFactory(this,
Util.getUserAgent(this, "cn.todev"))
val baseDataSource = dataSourceFactory.createDataSource()
val decryptDataSource = AesCipherDataSource("ENCRYPTION_KEY".toByteArray(), baseDataSource)
val videoSource = ProgressiveMediaSource.Factory { decryptDataSource }
.createMediaSource(Uri.parse(encryptPath))
// Prepare the player with the source.
player.prepare(videoSource)https://stackoverflow.com/questions/72376313
复制相似问题