Closed Mhnix closed 11 years ago
On my phone the browser after opening the URL almost instantly gives me the choice of openening it with a video player. Is this not the case for you?
The custom java code you are reffering to isn't used for anything else than file: URLs right now. All videos not streamed over RTMP is opened with QDesktopServices::openUrl() for which there is no way of manually setting the mime type.
Setting the mime-type to "video/" seams pretty ugly to me. The nice thing about opening in the browser is that (at least on my phone) the browser reads the Content-Type header returned by the server and creates a proper intent according to that. What is to say tha all video players that accepts "video/" can actually handle say "application/vnd.apple.mpegurl"?
Hmm, I had not tried the native browser... Opera Mobile and Dolphin Browser only wants to download. The native browser however works as you describe.
Ah ok, didn't think of other browsers. My solution might not be that good then after all. I might try to let Pirateplayer read the Content-Type header and start an intent accordingly.
I thought you already knew the mime type since you know the "suffix-hint" (at least the pirateplay API seems to know)?
A mime type is not the same thing as a filename suffix. Sure you could hardcode it, ie. look for .m3u8 in the url and set mime type to application/vnd.apple.mpegurl but reading the Content-Type header - as I suspect the native browser does - seams like a cleaner and more universal solution.
By falling back to "video/*" on Android, the program should not try to open the stream using a browser as it does now (when the url does not start with "file:" ):