-
Notifications
You must be signed in to change notification settings - Fork 65
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
Use downloaded video files? #23
Comments
Hey @Duncank, I just did this for my app with files downloaded from FileTransfer with one change.
convertedVideos.put(tagNames.getString(i), "file:///data/data/packagename.something.com/files/" + video[0] + ".mp4"); The plugin normally also tries to use a videoid int, but I am using video[0] for the file name instead. Granted I have only been needing to initialize one video at a time so I will let you know what happens when I try multiple. Let me know if this helps at all. Using a downloaded file location also makes it work on Android 4.4+ !!!!!!! Note: @jaeger25 |
Hey @gylippus is your change works only for Android 4.4+ ? I'm trying to get it to work on 4.2.2 but since the Webview does not allow file:/// I'm wondering how to play a video from the download location (cordova.file.dataDirectory) ? |
@winstef I used this solution for all version. I actually found though that certain devices (like HTC Desire and some Samsung) would not even allow using mediaPlayer from downloads in cordova.file.dataDirectory although almost every other device would. I ended up using cordova.file.externalDataDirectory in the end. The last hurdle that I'm still not 100% past is finding the absolute perfect codec combination to use in Handbrake of ffmpeg to cover 100% of devices with that as well. Just as a caveat, one other change I had to make for the HTC Desire was to set the file permissions manually after downloading via the download method of FileTransfer.java
|
Feel free to submit a pull request and I can merge any changes in Sent from my Windows Phone From: gylippusmailto:[email protected] @winstef I used this solution for all version. I actually found though that certain devices (like HTC Desire and some Samsung) would not even allow using mediaPlayer from downloads in cordova.file.dataDirectory although almost every other device would. I ended up using cordova.file.externalDataDirectory in the end. The last hurdle that I'm still not 100% past is finding the absolute perfect codec combination to use in Handbrake of ffmpeg to cover 100% of devices with that as well. Just as a caveat, one other change I had to make for the HTC Desire was to set the file permissions manually after downloading via the download method of FileTransfer.java
Reply to this email directly or view it on GitHub: |
@odbol & @Duncank Have either of you run into any issues with videos playing on some Samsung devices with custom ROMs? For some of our users the videos just show up as white boxes and nothing else. I gave in and bought a Samsung S3 and installed Dirty Unicorns 4.4.4 [Final KitKat Version]. When I review the Logcat logs I am getting the following error (the same error repeats about 20 times before failing on the last line) which point to an OpenGL issue which I haven't been able to find a workaround for yet:
|
Sorry I've never seen that before, and I've tested this on a SGS3 with stock 4.3 ROM. Seems like it's probably a custom ROM issue... |
Hy @gylippus , I've found the same errors, did you finally found a solution ? |
@lalop unfortunately not. Would love to find out a way to though. The only progress I was able to make on this was to at least test and confirm that it does indeed work fine if the app is using Crosswalk. We are going to work on trying to improve the error handling for the plugin and hopefully that might be able to shed some light. Will share anything we do find. |
@gylippus I've reencoded my video via handBrake, I can play it now |
@lalop, very interesting, any chance you can share the Handbrake settings that you used? Maybe even the video. Would be interested to it on the device we had the custom ROM on. |
I use the android preset, with 30fps, 1000kbps as average bitrate and profile baseline. |
@gylippus I attempt to play downloaded files by following your way:
Unfortunately the file still dont playback. Have you made other changes? |
I finally make it work by.. not using html5video at all. So for app which plays videos in a html tag and requires offline playback:
Hope this save hours of research for someone else. :) |
@sauvainr, are you using entry.toNativeURL() with and just setting it as video src? |
Hi just the fileEntry.toURL() method. |
Is it possible to use video files that have been downloaded to the device later? They end up in a data-folder or a folder on the sdcard, but not inside the app package itself.
The text was updated successfully, but these errors were encountered: