audio/video in phoneGap? - mobile-website

Can you please give me any sample related to audio/video? if the browser doesn't support HTML5, is it throw any error or ??
thanks
sri

on Iphone/Android:
m = new Media("mysong.mp3");
m.play()
on BlackBerry/Palm/Symbian
a = new Audio("mysong.mp3");
a.play();

Related

i need help in adding facebook share into my ios application

i am trying to add facebook share dialog into my ios application and i found the official page from facebook on how to do it, but i run into a problem about ContentProtocol. i dont know what that is. here is the link to the guidence that i use . it is pretty straight forward. basically just install the pod facebookshare, import it and add few line of code, but i got problem on 'myContent'
here is the code
import FacebookShare
let shareDialog = ShareDialog(content: myContent)
shareDialog.mode = .Native
shareDialog.failsOnInvalidData = true
shareDialog.completion = { result in
// Handle share results
}
try shareDialog.show()
here is the link
https://developers.facebook.com/docs/swift/sharing/share-dialog
what should i put in the myContent?
I guess next link is explained what you can use as content and how to use it
Content-types
(From documentation) Currently, the Facebook SDK for Swift can share 4 different kinds of content:
Links - Represented by the LinkShareContent object.
Photos - Represented by the PhotoShareContent object.
Videos - Represented by the VideoShareContent object.
Open Graph - Represented by the OpenGraphShareContent object.
you can use FBSDKShareLinkContent
let content : FBSDKShareLinkContent = FBSDKShareLinkContent()
content.contentURL = NSURL(string: "//URL")
content.contentTitle = "MyApp"
content.contentDescription = "//Desc"
content.imageURL = NSURL(string:"//Image URL")

Mapbox Directions API addWaypoint

I am working on a application and I want to get directions for more than 2 points
Which I assume other than origin and destination other locations are waypoints.
So I am trying to use directions.setWaypoint() to add waypoints to the map but it doesn't work
please help for me to understand what I do wrong.
I have created a JsFiddle https://jsfiddle.net/3uzm1nh0/1/
and this is the documentation I am referring to https://github.com/mapbox/mapbox-directions.js/blob/mb-pages/API.md
Thanks in advance.
You need someting like this
// = L.mapbox.directions({profile: 'mapbox.driving'})
var directions = L.mapbox.directions();
var directionsLayer = L.mapbox.directions.layer(directions).addTo(map);
var directionsRoutesControl = L.mapbox.directions.routesControl('routes', directions).addTo(map);
directions.setOrigin(L.latLng(14.6059596413528, -90.49169592683657));
directions.addWaypoint(0,L.latLng(14.60026436463006, -90.49669902226937));
directions.addWaypoint(1,L.latLng(14.59689160135752, -90.49520561914318));
directions.addWaypoint(2,L.latLng(14.60036292858185, -90.49586222238077));
directions.setDestination(L.latLng(14.6059596413528, -90.49169592683657));
directions.query();

facebook 3.5sdk open graph Explicitly Share

I'm trying to get my OpenGraph action to the news feed, and I learned that for that I need to add the ExplicitlyShared Capability to the Facebook app's OpenGraph action settings, and I did. Yet when I put it in my code, like this:
OpenGraphObject model = OpenGraphObject.Factory.createForPost("origame_app:model");
model.setProperty("title", modelname);
model.setProperty("url", "http://samples.ogp.me/1386546688246429");
model.setProperty("description", modeldesc);
Bitmap bitmap = decodeSampledBitmapFromUri(filepath[position], 500, 500);
List<Bitmap> images = new ArrayList<Bitmap>();
images.add(bitmap);
OpenGraphAction action = GraphObject.Factory.create(OpenGraphAction.class);
action.setProperty("model", model);
action.setExplicitlyShared(true);
#SuppressWarnings("deprecation")
FacebookDialog shareDialog = new FacebookDialog.OpenGraphActionDialogBuilder(this, action, "origame_app:fold", "model")
.setImageAttachmentsForObject("model", images, true)
.build();
uiHelper.trackPendingDialogCall(shareDialog.present());
I get an error. But otherwise the OpenGraph works great. What's the problem?
I was also dealing with this issue and finally, I found a workaround. Instead of calling
action.setExplicitlyShared(true);
use
action.setProperty("explicitly_shared", true);
I reported this bug to Facebook: https://developers.facebook.com/bugs/559486710849474/.

how to retrieve an image from path in iOS ( for iPhone) with Flex

How can I retrieve the path of an image stored in my album in an iPhone using Flex mobile? same with an image being taken with the camera on the iPhone.
for Android I use this function and it works, but for the iPhone, it doesn't any ideas?
protected function onMediaSelect(event:MediaEvent):void
{
var mp:MediaPromise = event.data;
image.source = mp.file.url;
}
and this I use for when I'm taking th picture ont he spot
protected function onComplete(evt:MediaEvent):void
{
img.source = evt.data.file.url;
}
if you can show me in the right direction I greatly appreciate it. thanks!
~Myy
image.source = File.desktopDirectory.resolvePath(file_name).url;
this one it will work only under windows...
image.source = File.desktopDirectory.resolvePath(file_name).nativePath;
the source property of Image passing a filename that start with / (/ is root for unix based OS, android, linux, ios, etc), will take is as a relative path instead of complete path...
I ad to use the cameraroll class
//if we get the image
trace( "Asynchronous media promise." );
var eventSource:IEventDispatcher = dataSource as IEventDispatcher;
eventSource.addEventListener( Event.COMPLETE, onMediaLoaded );

Extract image data from camera roll on Android?

Can anyone help me find out if/how you can get image data off of the 'camera roll' in an Android device, using (Appcelorator) Titanium ? I have found a 3rd party module for IOS that does this but I am desperate to find one for Android. Otherwise I'll have to scrap the Titanium and go true native.
What I need is a function that returns an array of data about the images on the device. Although I would love to get 'geolocation' data ( if it exists ), all I really need is a 'create date', and a path to the image, or the actual TiBlob.
Seems simple but i get no responses on the Appcelerator forums, which worries me. There must be at least an Android 'module' that achieves this?
Ti.Media.openPhotoGallery({
allowEditing : true,
success : function(event) {
var image = require('/modules/parts/squarecropper').crop(event.media);
setImage(image);
Ti.Media.hideCamera();
},
cancel : function() {
},
saveToPhotoGallery : false,
mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO],
});
The above method would do your job. Now then either access it directly or get into a file system and encode and decode the data.
var f = Titanium.Filesystem.getFile(currIamge);
var temp = f.read();
var encodeData = Ti.Utils.base64encode(temp);
alert("encodeData = "+encodeData);