Skip to content

Instantly share code, notes, and snippets.

@mw44118
Last active August 29, 2015 14:09
Show Gist options
  • Save mw44118/8d75d79cff21edf0c2cc to your computer and use it in GitHub Desktop.
Save mw44118/8d75d79cff21edf0c2cc to your computer and use it in GitHub Desktop.
can't get camera to open already-saved videos
self.pick_success = function (path_to_video) {
self.video_path(path_to_video);
};
self.pick_error = function (msg) {
navigator.notification.alert(msg);
};
self.pick_saved_video = function () {
if (!self.in_phonegap) {
throw new Error("Sorry, this is a phonegap-only feature!");
}
else {
navigator.camera.getPicture(
self.pick_success,
self.pick_error,
{
quality: 49,
destinationType: navigator.camera.DestinationType.FILE_URI,
sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY,
mediaType: navigator.camera.MediaType.VIDEO
}
);
}
};
<?xml version='1.0' encoding='utf-8'?>
<widget
id="com.giftgram"
version="0.0.1"
xmlns="http://www.w3.org/ns/widgets"
xmlns:gap="http://phonegap.com/ns/1.0"
xmlns:cdv="http://cordova.apache.org/ns/1.0">
<icon src="icon.png" width="313" height="126" />
<gap:splash src="splash.png" />
<name>GiftGram</name>
<description>
GiftGram lets you record a super-awesome, amazingly-personal video
message that arrives when your gift is delivered to your loved one's
door. It's the next best thing to being there!
</description>
<author email="support@giftgram.com" href="http://giftgram.com">
GiftGram Team
</author>
<content src="index.html" />
<access origin="*" />
<gap:platform name="ios" />
<gap:platform name="android" />
<gap:plugin name="org.apache.cordova.media-capture" />
<gap:plugin name="org.apache.cordova.file-transfer" />
<gap:plugin name="org.apache.cordova.file" />
<gap:plugin name="org.apache.cordova.dialogs" />
<gap:plugin name="org.apache.cordova.camera" />
<gap:plugin name="com.phonegap.plugins.facebookconnect" version="0.4.0">
<param name="APP_ID" value="268647116662002" />
<param name="APP_NAME" value="GiftGram" />
</gap:plugin>
<preference name="permissions" value="none" />
<feature name="http://api.phonegap.com/1.0/camera" />
<feature name="http://api.phonegap.com/1.0/file" />
</widget>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment