Make FrameworkMediaDrm more easy to customize
- Dominant language
- Java
- Stars
- 21.9k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
### [REQUIRED] Use case description
I'm trying to play a very exotic drm protected smoothstreaming format. To play correctly this format, I need to customize the initData used in the "getKeyRequest" method of the FrameworkMediaDrm class.
To solve this problem, I had to copy the entire FrameworkMediaDrm class content to a another "CustomFrameworkMediaDrm" class to modify the code.
The entire copy was the only possible solution because:
- FrameworkMediaDrm is final so it cannot be extended.
- FrameworkMediaDrm is not easy to delegate because of the "private static" methods.
Even a copy of FrameworkMediaDrm cannot be done easily because of ClearKeyUtil that is package restricted. (I had to remove all ClearKeyUtil references in my "CustomFrameworkMediaDrm").
### Proposed solution
Make FrameworkMediaDrm class not final and change the method "private static byte[] adjustRequestInitData" to non static "protected byte[] adjustRequestInitData" so that it will be possible to customize the initData by extending the FrameworkMediaDrm and override the adjustRequestInitData method.
### Alternatives considered
Maybe there is an alternative way, but I can't find it in the documentation. If there is an existing way to customize the initData it should be added in the doc.
I'm not sure about the achitecture considerations that made FrameworkMediaDrm so difficult to customize. If there are no problems with the proposed solution just tell me and I will try to create a pull request.
Thanks for reading this and for you work.
Contributor guide
Assessment
This issue has not been assessed yet.