yutasuzuki / react-native-record-screen

react-native-record-screen
MIT License
148 stars 39 forks source link

Unreachable iOS video path #73

Open stathisiakovidis opened 2 years ago

stathisiakovidis commented 2 years ago

Hi. I can't find video's path. Could you please save the video to a different location Photo Library?

skjortan23 commented 1 year ago

@stathisiakovidis You will need to write your own handler to handle the saving of the data. I am using MediaLibrary from expo to do this. e.g. https://docs.expo.dev/versions/latest/sdk/media-library/

e.g.


// Top-level module import
import * as MediaLibrary from "expo-media-library";
const saveImage = async (uri) => {
  try {
    // Request device storage access permission
    const { status } = await MediaLibrary.requestPermissionsAsync();
    if (status === "granted") {
    // Save image to media library
      await MediaLibrary.saveToLibraryAsync(uri);

      console.log("Image successfully saved");
    }
  } catch (error) {
    console.log(error);
  }
};

and call this with the url handed from this library. this will save the video to the users photos.