phonegap media API or HTML5 audio tag? - iphone

which is better to use for playing mp3 files in iphone application the phonegap media API or the html5 audio tag?

HTML5's tag will work with Phonegap, but your results will vary. Functions like audio.load() (assuming you're using javascript to control your HTML5 audio element) won't work. I would recommend using Phonegap's media API.

A regular HTML5 audio tag will work in a Cordova project, even when you load music from the file system, if and only if you have a content security policy.
You can create a content security policy online with this tool or study this great tutorial
Note that the Cordova default project has a CSP, while the current default Phonegap project does not.

Related

Can I use third party PhoneGap plugin on a web page using iOS Safari browser?

I am developing an application targeted only for iOS device(for now) using PhoneGap library and HTML5. This application is going to be only a web page accessed through iOS Safari browser. I am going to use certain features like accessing accelerometer, geolocation, contacts etc of iOS device using PhoneGap library.
Will I get access to all these features without installing anything on the device.
I want to understand how does PhoneGap get access to native features
of the device by just using JavaScript only?
I see there are several useful plugins written for PhoneGap library.
Can I simply use those plugins(js files) into my page without
installing anything on the device? E.g PhoneGap ChildBrowser plugin?
Will I get access to all these features without installing anything on the device.
You will have to build as a native ios app and install it to the device.
I want to understand how does PhoneGap get access to native features of the device by just using JavaScript only?
Phonegap provides a Javascript interface to access hardware features which are actually Objective-C functions. If you look at Phonegap source you'll see a lot of Objective-C code. So it's not only Javascript.
I see there are several useful plugins written for PhoneGap library. Can I simply use those plugins(js files) into my page without installing anything on the device? E.g PhoneGap ChildBrowser plugin?
No. They have to be inside an iOS app to be able to work.
It seems like what your after is a way to access the features of an APP only through the browser.
You can access some things using HTML5 e.g.:
Geo location http://html5demos.com/geo
Accelerometer http://menscher.com/teaching/woaa/examples/html5_accelerometer.html
Video Embedding http://www.w3schools.com/html5/html5_video.asp

Swf file:What is the best way to develop swf file?

I know we can generate swf file by creating action script project in flex sdk and also using cs5 we can create swf file. I want to create swf files for running in mobile devices like android,iphone. What is the best approach to create a swf file that runs in both android and iphone. I am very new to swf technology. please guide me.
thanks.....
Flash is not supported in iOS so there is no way of showing it on iPhone or iPad.
Take a look at Google's Swiffy Project it allows SWF to HTML5 conversion, allowing the content to be displayed on iPhone.

Phonegap facebook, html5 video, iAds issues

I'm trying to build android+iOS application via phonegap build API. I found that that this api has some limitations, but I want to make sure...
1) Implementation Facebook features to phonegap application is possible only by phonegap plugin, which is not able to add via build API.
2) iAds aren't also supported. I found some plugin which can handle this, but as in first point, it is not possible to add plugins via phonegap build API.
3) Playing video using HTML5 video tag doesn't work if operation system of device doesn't have installed needed codecs. And there is no other way how to be sure that some type of video will be playable on most androis/iOS devices.
...so when I want to build applications via phonegap API, I have to forget to use facebook, iAds and video(on all devices) ?
Thank you.
For your first question: in the case of facebook some facebook plugins exist, you may want to look here:
http://www.mosacrea.com/how-to-post-to-the-facebook-wall-in-an-iphone-app-with-phonegap-facebook-connect-and-childbrother-plugin/ it uses the ChildBrowser plugin..
or here:
http://eisabainyo.net/weblog/2011/06/25/how-to-post-on-facebook-wall-on-iphone-and-android-using-phonegap-plugins/ same thing but with a slightly different approach.
hope it helps...

Flash Component in iPhone

i have few questions regarding flash components in iphone
I would like to know if a safari browser in iphone can play a flash component(swf file).
Do i need to download a plugin for safari ? If so will the plugin update the existing safari browser or will it be another standalone application which plays the swf file in the safari browser? same doubt i have with mozilla browser in iphone.
I have a swf file .Will i be able to embed that to a native application in iphone.
I saw that iphone flash application can be developed and such applications are present in app store.If so which version of adobe flash has that capability ? (cs4 or cs5)
The Flash plugin is not available on iPhone, and will certainly never be...
You might take a look at Adobe Flash CS5, which will be able to create native iPhone apps from AS code.
http://labs.adobe.com/technologies/flashcs5/appsfor_iphone/
You might be able to embed a Flash SWF into your app using Hirameki. Still not ready for market, but it plays Flash animations directly from a SWF file inside a native app.
http://flash-on-iphone.com/demo

Is there any way to play video on an iphone from a website, without using youtube or a custom app?

I'd like website viewers to be able to play a video on an iphone, without posting the video to youtube, and without them having to install any iphone apps. Are there any other options here?
If you host a Quicktime movie, it'll play just fine without any additional software. There is a "designing web pages for the iPhone" document somewhere on Apple's web site that gives more detail on supported formats, I think.
just having a link to a quicktime-playable video file works I believe