ExoPlayer
ExoPlayer copied to clipboard
Custom data source reading from zip file not working
I tried to write a ZipDataSource, and used both inputstream = zipFile.getInputStream(videoEntry) fromjava.util.zip.ZipFile package and inputstream = zipFile.getInputStream(videoFileHeader) from net.lingala.zip4j.ZipFile package, but none of them worked due to "UnrecognizedInputFormatException".
Difficult to say what isn't right here. I think I would first unzip that file manually and stream it this way. Once this works, you can do the same with the ZIP source like you suggested above and compare the bytes you get from the zip stream as compared to the working unzipped stream.
Yes, the unzip files work fine. I don't know how to compare bytes from different streams.
You would need to dump this to a file or similar. It's actually not about doing an analysis of the diff, but more to make sure that unzipping the file programmatically results in the same data as unzipping it with a tool.
If you see this works from the unzipped file but not from what you get when using the ZIP library of your choice, then the logic of programmatically unzipping needs to be changed.
I can't give you extensive support for this I'm afraid. Maybe someone from the community has more experience in this and can give you a hand. So I'm leaving this open for a while.