cordova-plugin-media icon indicating copy to clipboard operation
cordova-plugin-media copied to clipboard

Added fp.exists() false negative shield.

Open agamemnus opened this issue 11 years ago • 16 comments
trafficstars

The Media API doesn't account for cases where fp.exists() may provide a false negative. (For example, APK expansions...)

Cosmetic: I also did a short-circuit on the first condition, converted to "} else {"s instead of hanging brackets, and fixed the incorrect spacing in the last few lines. (caused probably by the hanging brackets!)

agamemnus avatar Sep 11 '14 16:09 agamemnus

Actually, I am not entirely sure why FileInputStream fileInputStream = new FileInputStream(file) isn't used for the second case of Environment.getExternalStorageDirectory().getPath() + "/" + file... was that a bug, also?

agamemnus avatar Sep 11 '14 17:09 agamemnus

It may have been a bug; I like the way that you've done it, though, regardless.

Do you have an ICLA on file with Apache? I can't tell by your Github username. Also, I'd like to have an issue on our JIRA tracker (https://issues.apache.org/jira) for it for future reference.

Thanks!

clelland avatar Nov 28 '14 16:11 clelland

Gee, that ICLA thing is pretty formal. I'll email that ASAP...

agamemnus avatar Nov 28 '14 16:11 agamemnus

I sent in a signed and scanned ICLA to Apache's secretary email.

agamemnus avatar Dec 08 '14 20:12 agamemnus

I got the email back saying it was received.

https://issues.apache.org/jira/secure/Dashboard.jspa doesn't want to load.

agamemnus avatar Jan 03 '15 00:01 agamemnus

I am still in shock reading that you can't use Android expansion files with the Cordova Media plugin to play sounds. I have a 150mb project that uses a lot of sound and I've developed it using the Media plugin. Is it true that you can't use the Media plugin with Android expansion files??? What to do???

vispo avatar Mar 16 '15 01:03 vispo

@vispo and there seems to be some problem with android 5.0 and media plugin. I am working in a project which uses media plugin to play audio. The application works well in all versions of android but 5.0.

pniraula avatar Mar 16 '15 01:03 pniraula

vispo, you can use Crosswalk and do xwalk --disable-gesture-requirement-for-media-playback in [root]\platforms\android\assets\xwalk-command-line.

agamemnus avatar Mar 16 '15 01:03 agamemnus

Have never heard of Crosswalk before. I see it at https://crosswalk-project.org . Is it a Phonegap plugin or something entirely separate from Phonegap?

vispo avatar Mar 16 '15 01:03 vispo

I hear that Amazon allows Android apps up to 150mb in size. I could probably get away without having to use an expansion file if we distribute it through Amazon rather than the Google Play Store. Have you distributed an Android app through Amazon? Is it OK? Limitations?

vispo avatar Mar 16 '15 02:03 vispo

(To clarify, you don't need the Media plugin if you use the --disable-gesture-requirement-for-media-playback switch.)

I have not tried using Amazon to publish my game.

Crosswalk is a system that adds a standalone version of Chromium to your Android Cordova app or game. It's only a few steps to use it via the "migrate" option. Crosswalk is well-supported by Intel and a growing base of users.

P.S.: if you do use Crosswalk and expansion files, I made an Android expansion file plugin here: https://github.com/agamemnus/cordova-plugin-xapkreader.

agamemnus avatar Mar 16 '15 03:03 agamemnus

Cordova CI Build has one or more failures.

Commit - Link Dashboard - Link

Builder Name Console Output Test Report Device Logs
Windows 8.1 Store Link Link Link
Windows 10 Store Link Link Link
Windows 8.1 Phone Link Link Link
iOS Link Link Link
Android Mac Link Link Link

cordova-qa avatar May 18 '16 01:05 cordova-qa

Hard to see.... too many links....

agamemnus avatar May 18 '16 01:05 agamemnus

It's been a loooong time @agamemnus , but can you maybe still explain what

cases where fp.exists() may provide a false negative. (For example, APK expansions...)

actually meant? Can you provide some context on how to test this? Thanks.

janpio avatar Aug 18 '18 16:08 janpio

You'd have to install both my plugin and that one and you will see that the test identifies the file as not existing when it actually does, IIRC. Problem is, Google has been very bad in supporting APK expansions and they keep making changes that makes it very difficult to maintain.

agamemnus avatar Aug 18 '18 18:08 agamemnus

Ok, so this is kind of an edge case? Anyway, I think your code itself is pretty reasonable. Can you describe exactly what is happening with the files in plain English though? From top to bottom of your change...

janpio avatar Aug 18 '18 20:08 janpio