Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass the tag in MediaItem to the customData of DataSpec? #1111

Open
fanmingyi opened this issue Feb 21, 2024 · 0 comments
Open

How to pass the tag in MediaItem to the customData of DataSpec? #1111

fanmingyi opened this issue Feb 21, 2024 · 0 comments

Comments

@fanmingyi
Copy link

Hi guys:
Each of my audio sources needs to be symmetrically decrypted with a different key. For this purpose, I customized a DataSource and decrypted it in the read function. I put the key information in the tag of MediaItem. I saw that the open function of DataSource will pass in dataSpec, and DataSpec will have a customData field. Because I want to use customData to transmit key information.I don't know how to implement the above ideas, I hope everyone can provide some solutions. My other solution is to create a DataSource.Factory each time I play and pass a key to the object, but this makes the code look very "Dirty"。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants