I'm recording/selecting video with media-capture plugin, convert it to mp4 with video-editor plugin and after the user confirms the selection I copy/move this file to app specific media dir (something like /storage/emulated/0/APPNAME/Video/).
Everything works fine, except that if the user tries to open the video file immediately, the native video player will open but there'll be a message like "Could not play video" (on android) and the console.log shows the error "File not found".
This happens on both iOS and Android.
I use this plugin to open video files in native players.
If I exit the app and reopen it, the issue dissapears. So the problem is, I think, that the system does not know about the existance of that new copied/moved file. Is there a way to refresh the filesystem?
I have checkd the file URI that I pass to the openfile plugin and it's the same when it works & when it doesn't.
I use HTML5 FileSystem to copy/move files.
I use promisses, I wait until files are copied/moved, so it's not this the issue.
Related
I'm using Ionic to create an app. In this app, there is the possibility to create a audio file. For ios there will be a .m4a file. For Android there is a .3gp file. These files are saved on a server. Other users can get these audio files and listen them. So far, so good.
The issue is when a ios user records an audio file and a android user wants to listen to this file. Are there Ionic users out there that succesfully made a cross-platform audio sharing app?
I'd like to generate a signed link via S3 and then allow a mobile user to download this file. So far this is going okay (downloads with the correct name, filesize, etc).
However - when it comes to opening it (even a .png), I get the message "Cannot open file" and it doesn't turn up in the device's photos, gallery, or anything like that.
Are there some kind of headers missing? Some extra bit of set-up?
The context is a React Native app where the user requests a file, opens the URL via Linking in Chrome, Chrome downloads it, and then they can open it properly. Ideally this will work for any file types (e.g. png, jpg, docx, pdf). Thanks!
If you can't do this in ReactNative, you can always leverage on a native picker. https://developer.android.com/guide/topics/providers/document-provider in any case, there are tons of information to open files in ReactNative with some extensions as: https://github.com/huangzuizui/react-native-file-opener. I tried a couple of them and they work. It should do the job, check the permissions in your application as well. It can be a headers problem so you need to check all of this.
I am using the cordova 3.4.0 and trying to upload a file, using the file transfer and file api plugins given by cordova, but i am not able to open the file browser window, in order to select the file to upload. How do i open the file browser window in android using the corodva
I used an Input tag in my html, like so:
<input type='file' id='fileInput'>
And then when it is clicked on the Android device, I get a pop-up asking me which file browser I want to use. My Galaxy S3 gives me seven choices (one of which is a downloaded app), and the Panasonic ToughPad I'm developing for gives me three (one of which is the same downloaded app I have on the phone).
I do not know if it is possible to get it to automatically select one in particular - for me, choosing a file manually is supposed to be a temporary need, as eventually the app is supposed to load specific files automatically.
I want to make something like this :
<audio controls>
<source src="media/blablabla.mp3" type="audio/mpeg"></source>
</audio>
I run my app on local host :8080/console and it worked (The music can played). But when I run that apps on my device, the music can't played.
My Device OS is Android 4.1.2
See this question for an answer: IBM Worklight 6.1 - Unable to play a local media file using Cordova
Copy-paste of my answer:
... for playing a local media file, you need to provide the full path
to the media file's location where it'll be in the generated Android
project. For example, if you create a common\audio folder in the
Worklight application and place a .mp3 file in it, you need to use the
following path (in the HTML or JavaScript, or however you'd like...):
Play Audio
Sample project: Android Cordova Media API
I have few SWF Files which I want to run view on my Android Device.
Earlier I was viewing those files in webview using flash player but now as flash player plugin is no more available on play store so the person who has not flash player plugin already can not view those files.
How can I show my SWF files without using Flash Player Plugin ?
You can use opensource code like SWFDec, but you have to porting it on android by yourself.
How to porting:
1. download swfdec source code from http://swfdec.freedesktop.org
2. cross-compile swfdec source code for android platform
3. read swfdec source code to find how to blit swfdec surface to android view
Google's Swiffy makes Flash files HTML5 friendly.
Google's cooked up a new tool in its labs that converts SWF files into HTML5 for use on devices that can't run Flash, including those made by Apple.
I use Adobe AIR for swf files to play b'cause its still free, but it does require you to sign up.. Here is setup require to getting started with Adobe AIR.. There is lot of stuff in that link well, you require only app, for viewing .swf file...
Firefox comes with SWF support. I had to play a SWF file in Android. Here's how I did it.
Download the SWF file to store locally in your device. Most likely by default it will be in the root/sdcard/download folder.
Open Firefox browser. Type in the URL file://root/sdcard/download/myFlashFilename.swf
It should show a "Tap to activate plugin" or similar message. Tap it and it should work.
Add this to Bookmark and Add to Home Screen for easy access.