Embedding mp3 in apk (for phonegap/jquery mobile build) - jquery-mobile

i m developing a music app using phonegap/jquery mobile using aide for phonegap. I want embed some mp3 songs in the apk build. how can i do this.

Agreed with #QuickFix. Put somewhere in the www folder.
For my case, the build process ignored folder starting with underscore ie "_mp3". I removed the underscore then it works.

Put the files in the folder and use the Cordova Media API to play the audio
var media = new Media('audio.mp3');
media.play();
Documentation here: https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md

Related

how to access local files from ionic iOS app for uploading video and audio

Actually I'm using iOS file picker for uploading audio and video files from my app. Is there any way to access local files from any app? Is it possible or not?
You can check file directory structure to upload a file for iOS. The link is:
https://github.com/apache/cordova-plugin-file#where-to-store-files
You can read iOS local file using cordova.file.documentsDirectory

How to search through iPhone filesystem downloads folder for mp3 files in react native

I'm working on an react native ios app where I want to look through the iPhone's downloads folder for .mp3 files that I can play. I've found a library react-native-fs but right now I am only able to see files added to my app and I can't figure out how to search for .mp3 files already on the iPhone. Any advice on libraries to use or code would be appreciated.
Code for my project: https://github.com/Laybium/laybium
In iOS apps have access only to their sandboxes. There's no such a thing as a Downloads folder, because there's no folder all apps may share.

Handle local files in default iOS application

I have files that are stored in the Document directory. The url scheme for them is file:/// and so on. Is there a way to handle such files with appropriate default app. Lets say I have a video file there and instead of handling play in my app, it opens in the default iOS app for video playback. Or maybe I have a doc file and it should open in MS Word if it is installed.
What I tried is this. It did not work. I believe the openURL method depends on the URL scheme which is always file:/// in this case. Even if I know what type of file it is, how do I go about opening it in default outside application.
What I did was use UIDocumentInteractionController.
You can preview and choose to open in other app. Or you can just open.
It works for documents, video and probably audio(not tested) files. The preview player for the video is not that great.
For a demo tuts.plus.

How to export downloaded audio file(from within app folder) to user accessible music folder in IOS

I am using Xamarin to develop an IOS app. Here the user has an option to download audio files to the document folder within the app, and play it later on.
But i would like to provide an option for the user to access it in music folder or somewhere else, so that user does not have to come back to app to listen it.
Like we save images to camera roll, can we save mp3 or any other audio file to default music folder in IOS. Any solution or ideas using xamarin or xcode are welcome.
Note: I already know about File Sharing with itunes, i am looking for something else explained above.
As I know this isn't possible due to the limitations within iOS

Prevent native video player in sencha touch 2

I'm building an app for iOS and android using sencha touch 2.3.1 (using sencha architect 3 as my IDE if that's useful to know) and I want to be able to play video inline, as opposed to an embedded video that opens up the native video player after the user taps on it. A perfect example of the functionality I'm after would be the Vine app (at least for iOS, I haven't looked at it on android), videos simply play right there on the page without the native iOS video player taking over.
I'm aware of the allowsInlineMediaPlayback property of UIWebView, but I have no clue how to set that, or even whether I can, since I'm not building a native app in xcode (in fact I have no experience doing so, this is my first attempt at building any sort of mobile application).
How do you plan to package your application to run on a mobile device? The html/js/css what you are creating needs to be packaged on some way to have a mobile app. You can use sencha cmd for that but phonegap is sort of more popular for that. If you will use phonegap then you can set this in the config.xml. See http://docs.phonegap.com/en/2.2.0/guide_project-settings_ios_index.md.html
I managed to get this working by installing cordova on my machine, then running the
sencha cordova init
command on my sencha project folder. After that I simply made sure allowsInlineMediaPlayback was set in my cordova config and that my video tag/object in Architect had the webkit-playsinline attribute set to "1".
If you're interested I am still able to continue my normal development and build workflow in Architect (Architect is now compatible with Cordova, though make sure you add
{
"path": "cordova.js",
"remote": true
}
to your app.json manually. Note you only need that entry in the js section of your app.json and DO NOT NEED THE ACTUAL CORDOVA.JS FILE TO BE IN YOUR PROJECT FOLDER, Architect will handle this when you run your build command).

Resources