Please I am looking to use intent/webintent to open an app that can be used as a file browser/explorer for selecting audio files.
The URL(fullpath) for selected item would then be passed as source for in app media.play().
Any samples would be welcome.
Thanks.
Ismael.
You might check my plugin for Phonegap, which as I believe can do what you need.
https://github.com/markeeftb/FileOpener
All you gotta do is to pass a variable with the local path of the file:
window.plugins.fileOpener.open("file:///mnt.sdcard/Android/data/com.example.app")
You would only need to correct FileOpener.java file, so it matches file types you want to handle, for example mp3, wav etc.
Related
Hi onto my react app I need to see a document but I cannot upload it manually. I'll explain, the user if need, could upload a document and into another part of the app could see it.
I want to know if there's a possibility to organize something like
See document
So the user onClick can see the doc opened in another tab. I do some logic but I upload the document on my store after he can see it in the review mode.
So can I visualize it without charging it on localStorage or sessionStorage, should I use an external library?
It depends on the format of the document. if it's an image you can show it by encoding it to base64 for other types of documents I'm afraid you have to have it stored at some URL.
You don't need to upload it anywhere to open it, after the 'upload' (using the file chooser) you can store it in a variable and use it as you please (keep in mind that this is not always a good approach). However if you want to visualize\open it in the application, it depends on the file format and you might need to use an external library to interpret and present it
edit: add note in parenthesis
I want to create some extension to VSCode using its Webview feature. I want to show HTML preview as a feature of my extension. As I can see in VSCode API documentation of WebView the paths for resources have to be registered and edit in a special way.
I want to load HTML from the file and then edit and register all paths to CSS and JS into it to create the preview of this one. In my opinion, using some DOM manipulating is the easiest way to create it. Simple import of jsdom doesn't work, even if the same example works in plain Node.js. Have anyone done a similar thing in the way it works well? Maybe there is some other way to solve this problem.
Thank you in advance.
I have done this in the past and the way that it worked was to read that file (with fs in my case) that contains the HTML and render it afterwards. Any resources you want to use have to be passed inside the localResourceRoots array as an option in the vscode.ViewColumn.
Here is a full example:
const panel = vscode.window.createWebviewPanel(
'catCoding',
'Cat Coding',
vscode.ViewColumn.One,
{
// Only allow the webview to access resources in our extension's media directory
localResourceRoots: [vscode.Uri.file(path.join(context.extensionPath, 'media'))]
}
);
I like to save images to my hard-drive to create mood-board for art projects. I usually use Date.now() in chrome's console to create a string of number and copy the number as my file name - so the saved images are in the an order - it is easier for me to look them up later.
I thought, it would be convenient if I create an extension to help me to accomplish this.
So I want to create a new option in the context menu and call it "Download This Image" and when I click it, it will automatically generate a string of number and use them as the default file name. Unfortunately, it doesn't quite work out.
The reason I want to create a new option is that, most of the time, I don't want to change the filename of the images I download. I only want to change them when I want to save them to my inspirational folder.
Okay. I solved this. Here is the extension's source code if anyone is interested.
https://github.com/aeroxy/save_image
Is there a way to create a file outside of the sandbox? Maybe something that works by first storing the file inside the sandbox and then letting the user drag a link to the locally stored file into a regular folder?
It is for a webchat: I want the user to be able to receive files, but I can't figure out a way that ensures that he can choose the target location that doesn't need a right-click->save as. If there is a better solution than using the filesystem API, feel free to suggest that, too.
How about an "a" element with a download attribute, and using FileEntry.toURL() to populate the href target?
Use a signed java applet to get root access to the system
For learning purposes I created a toy project using grails.
In this project I would like to play an mp3 file in one of my views.
I found an html5/flash mp3 player. But when the music is supposed to play, I have a question.
The HTML 5 player is in the project/web-app/js folder. Everything else is in its normal place.
When I try to access a file, let's say "test.mp3" using just the name and extension of the file, where this file is supposed to be?
The file should be relative to whatever your current path is.
That is, if you're at
localhost:8080/myapp/test/test1, and you reference test.mp3, test.mp3 would have to be in the test1 directory. You can use absolute paths, such as /sounds/test.mp3 to reference from the root, but a better solution would be to use ${resource(...)} probably.
Here's the resource documentation.