[CameraRoll] support fetching videos from the camera roll
Summary: This adds a parameter for fetching videos from the camera roll. It also changes the default to fetch both videos and photos. Closes https://github.com/facebook/react-native/pull/774 Github Author: Joshua Sierles <joshua@diluvia.net> Test Plan: Imported from GitHub, without a `Test Plan:` line.
This commit is contained in:
parent
9eeeae9005
commit
6b163a4a9a
|
@ -29,8 +29,16 @@ var GROUP_TYPES_OPTIONS = [
|
|||
'SavedPhotos', // default
|
||||
];
|
||||
|
||||
var ASSET_TYPE_OPTIONS = [
|
||||
'All',
|
||||
'Videos',
|
||||
'Photos', // default
|
||||
];
|
||||
|
||||
|
||||
// Flow treats Object and Array as disjoint types, currently.
|
||||
deepFreezeAndThrowOnMutationInDev((GROUP_TYPES_OPTIONS: any));
|
||||
deepFreezeAndThrowOnMutationInDev((ASSET_TYPE_OPTIONS: any));
|
||||
|
||||
/**
|
||||
* Shape of the param arg for the `getPhotos` function.
|
||||
|
@ -58,6 +66,11 @@ var getPhotosParamChecker = createStrictShapeTypeChecker({
|
|||
* titles.
|
||||
*/
|
||||
groupName: ReactPropTypes.string,
|
||||
|
||||
/**
|
||||
* Specifies filter on asset type
|
||||
*/
|
||||
assetType: ReactPropTypes.oneOf(ASSET_TYPE_OPTIONS),
|
||||
});
|
||||
|
||||
/**
|
||||
|
@ -94,6 +107,7 @@ var getPhotosReturnChecker = createStrictShapeTypeChecker({
|
|||
class CameraRoll {
|
||||
|
||||
static GroupTypesOptions: Array<string>;
|
||||
static AssetTypeOptions: Array<string>;
|
||||
/**
|
||||
* Saves the image with tag `tag` to the camera roll.
|
||||
*
|
||||
|
@ -154,5 +168,6 @@ class CameraRoll {
|
|||
}
|
||||
|
||||
CameraRoll.GroupTypesOptions = GROUP_TYPES_OPTIONS;
|
||||
CameraRoll.AssetTypeOptions = ASSET_TYPE_OPTIONS;
|
||||
|
||||
module.exports = CameraRoll;
|
||||
|
|
Loading…
Reference in New Issue