forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This PR adds the ability to export videos to the CameraRoll on both Android and iOS (previously only photos were possible, at least on iOS). The API has changed as follows: ``` // old saveImageWithTag(tag: string): Promise<string> // new saveToCameraRoll(tag: string, type?: 'photo' | 'video'): Promise<string> ``` if no `type` parameter is passed, `video` is inferred if the tag ends with ".mov" or ".mp4", otherwise `photo` is assumed. I've left in the `saveImageWithTag` method for now with a deprecation warning. **Test plan (required)** I created the following very simple app to test exporting photos and videos to the CameraRoll, and ran it on both iOS and Android. The functionality works as intended on both platforms. ```js // index.js /** * Sample React Native App * https://github.com/facebook/react-native * flow */ import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View, CameraRoll, } from 'react-native'; import FS fro Closes facebook#7988 Differential Revision: D3401251 Pulled By: nicklockwood fbshipit-source-id: af3fc24e6fa5b84ac377e9173f3709c6f9795f20
- Loading branch information
Showing
3 changed files
with
70 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters