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

Doesn't work with long URLs #14

Closed
mightyfrog opened this issue Sep 21, 2015 · 5 comments
Closed

Doesn't work with long URLs #14

mightyfrog opened this issue Sep 21, 2015 · 5 comments
Labels

Comments

@mightyfrog
Copy link

Cache file name exceeds the file system's maximum length.

@danikula
Copy link
Owner

@mightyfrog Can you provide example of url that cause this problem?

@danikula danikula added the bug label Sep 21, 2015
@mightyfrog
Copy link
Author

I found the issue while playing a video from vid.me. All the vidoes from vid.me have a URL like this:

https://d1wst0behutosd.cloudfront.net/videos/4367900/10807247.480p.mp4?Expires=1442849176&Signature=JXV~3AoI0rWcGuZBywg3-ukf6Ycw2X8v7Htog3lyvuFwp8o6VUEDFUsTC9-XtIGu-ULxCd7dP3fvB306lRyGFxdvf-sXLX~ar~HCQ7lullNyeLtp8BJOT5Y~W5rJE7X-AZaueNcycGtLFRhRtr5ySTguwtmJNaO3T1apX~-oVrFh1dWStEKbuPoXY04RgkmhMHoFgtwgXMC1ctIDeQHxZeXLi6LLyZnQsgzlUDffCx4P16iiW0uh2-Z~HUOi9BLBwHMQ5k5lYwZqdQ6DhhYoWlniRfQz6mp1IEiMgr4L3Z1ijgGITV4cYeF31CmFzCxaJTE7IIAC5tMDQSTt7M9Q4A__&Key-Pair-Id=APKAJJ6WELAPEP47UKWQ

Md5FileNameGenerator generates a long file name so I made my own by subclassing FileNameGenerator. It appeared working first but I found buffering not working and exiting app clears cache :(

*the above link probably doesn't work as it requires a session or something but I think you can reproduce the issue with the orange video from sample by appending a very long query string to it.

@danikula
Copy link
Owner

@mightyfrog fixed in 2.1.1
Please, update your projects.
Thanks for contributing.

@mightyfrog
Copy link
Author

Wow, that was quick. Thanks.

@danikula
Copy link
Owner

@mightyfrog One important note. If url contain some dynamic data like a session token AndroidVideoCache will not work correctly, because it doesn't know that these urls point to the same video. For example you have 2 urls : http://videos.com/video.mp4?token=abc and http://videos.com/video.mp4?token=xyz . Urls are different but point to same video video.mp4. In this case AndroidVideoCache will cache it twice! To prevent it you have to implement your FileNameGenerator.

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

No branches or pull requests

2 participants