media
media copied to clipboard
How to pass the tag in MediaItem to the customData of DataSpec?
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"。