如何使用android.drm框架 [英] How to use android.drm framework

查看:178
本文介绍了如何使用android.drm框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发基于DRM的android应用. 该应用程序旨在在下载(音频,视频)并获得对文件(音频,视频)的控制访问权之后对(音频,视频)文件进行加密,以防止文件(音频,视频)复制和粘贴并过期,因此无法再查看它们.为此,我正在使用android.drm

I am developing an android app based on DRM. Application is intended to encrypt the (audio,video) files after downloading and getting control access on the files(audio,video)preventing the file(audio,Video) copy and paste and expire documents so they can no longer be viewed. for this i am using android.drm

我搜索了很多,但没有得到任何结果

I have searched a lot but didn't get any result

因此,请分享一些示例代码,这些代码说明如何使用DRM框架api.

So please share some sample code that explain how to use DRM framework api.

引用:

https://www.widevine.com/wv_drm.html

https://source.android.com/devices/drm

https://developer.android.com/reference/android/drm/package-summary.html

推荐答案

在大多数DRM方案中,从DRM的角度来看,Android设备将是客户端,而不是服务器.

In most DRM scenarios, the Android device would be the client from a DRM point of view, rather than the sever.

换句话说,Android设备通常是回放设备,需要向DRM系统询问用于查看内容的密钥.

In other words the Android device would typically be the playback device which needs to ask a DRM system for a key to view the content.

从理论上讲,没有理由不能将Android设备用作打包程序或对内容进行加密,但这不是规范,因此,它不是如何设置Android中的DRM框架或示例.

There is no reason in theory why an Android devices couldn't act as a packager or encrypted for content, but it is not the norm so its not how the DRM framework or example in Android will be set up.

如果您确实想了解如何在设备上播放受DRM保护的内容,那么Exoplayer演示中有很好的工作示例.

If you do want to see how to play back DRM protected content on the device, then the Exoplayer demo has good working examples.

以DefaultDRMSessionManager为起点:

Take a look at the DefaultDRMSessionManager as a starting point: https://github.com/google/ExoPlayer/blob/d979469659861f7fe1d39d153b90bdff1ab479cc/library/core/src/main/java/com/google/android/exoplayer2/drm/DefaultDrmSessionManager.java

更新

受保护内容的示例工作流程:

An example workflow for protected content:

  1. 内容已在服务器上提取(即以某种方式加载或放置在流服务器上)
  2. 内容已在DRM许可证服务器中注册,并请求了加密密钥
  3. 当用户请求视频文件时,该文件将打包到该设备的相应流协议中(通常是Android的MPEG DASH),并使用从DRM服务器接收到的密钥对视频文件进行加密.
  4. 请求该流的设备(例如您的Android设备)接收到该流,并标识该流已加密.它从许可证服务器请求许可证密钥.在使用Widevine DRM的Android设备上,播放器配置中必须包含许可服务器的URL.
  5. DRM服务器将密钥安全地发送到可播放内容的Android设备.使用DRM系统和设备安全媒体路径播放密钥或未加密内容时,应用程序甚至OS都看不到密钥或未加密内容.

流服务器和DRM服务器通常是非常复杂的系统,您不太可能想要自己构建.

Streaming servers and DRM servers are generally quite complicated systems and it is unlikely you would want to build either yourself.

对于流服务器,您可以查看并使用开放源代码示例-例如: https://gstreamer.freedesktop.org

For streaming server there are open source examples you can look at and use - e.g.: https://gstreamer.freedesktop.org

如果您想尝试DRM,则可以将Clearkey DRM与MPEG DASH一起使用,Exoplayer将支持.它不如常规DRM方案安全,但它是免费的,因此值得检查它是否满足您的需求.

If you want to experiment with DRM then you can use clearkey DRM with MPEG DASH which Exoplayer will support. It is not as secure as the regular DRM schemes but it is free so it is worth checking if it meets your needs.

某些编码服务允许您尝试设置clearkey-在此处查看示例: https://bitmovin.com/tutorials/mpeg-cenc-clearkey-drm-encryption/

Some encoding services allow you experiment with clearkey set up - see an example here: https://bitmovin.com/tutorials/mpeg-cenc-clearkey-drm-encryption/

这篇关于如何使用android.drm框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆