halilozercan / BetterVideoPlayer

Video playback on Android, made better in Kotlin, wrapping around the stock MediaPlayer API.
286 stars 95 forks source link

Ability to load subtitles from storage #11

Open tonywamba opened 7 years ago

tonywamba commented 7 years ago

I personally need this feature so bad. Loading from raw resource isn't really useful since Captions are most of the time downloaded at runtime.

halilozercan commented 7 years ago

This feature crossed my mind so many times but never got to implement it. The reason is permissions. After Android 6(M), permissions are a bit tricky to handle by the library. Some libraries have helper tools to deal with runtime permissions, some others completely leave it to application side. What is your suggestion on this one? How do you think BVP should handle read permissions?

Also, should BVP supplement a file chooser?

tonywamba commented 7 years ago

Well I've never wrote a Library before so I don't really know how different or tricky it is when it comes to requesting permissions after Marshmallow. But if there is a way from the library code to know if a permission is granted, then it should be easy right? But if there isn't(I guess thats the case) then You assume you have the permissions and implement the feature. Then leave that job to the Dev using your library to make sure the user has granted the permission before trying to load a subtile into BVP from storage.

tonywamba commented 7 years ago

For now what I do is serve the Subtitle file at runtime using a tiny local server(nanohttpd) and thats pretty complicated. This feature will save my life and other people's too I guess.

tonywamba commented 7 years ago

And yes off course adding a file Chooser to the feature will be pretty awesome

VAHID-ZAHEDI commented 7 years ago

this is my problem when i try to load subtitle from storage its show nothing.

Hitexroid commented 6 years ago

see this #47