Giter VIP home page Giter VIP logo

Comments (9)

trops avatar trops commented on September 27, 2024 1

eh, spoke to soon man, it appears that it is uploading the file, but it wont play for some reason. Im uploading 2-3 second clips to test and the file size is 1.8MB or around there, but the video is 0 seconds. corrupt somehow. Im trying to work through it to see if something is fishy on my end...

Ill post some code for you in a moment.

from react-native-aws3.

benjreinhart avatar benjreinhart commented on September 27, 2024

Although I feel like this should work, I have never tested video uploads. The only uploads I've tested myself are images. Perhaps someone else has experience with uploading files that are something other than jpg/png images?

from react-native-aws3.

trops avatar trops commented on September 27, 2024

from react-native-aws3.

benjreinhart avatar benjreinhart commented on September 27, 2024

Cool, I'm going to close this then.

from react-native-aws3.

trops avatar trops commented on September 27, 2024

So here is the sample code I have for the upload for iOS....Ill have to change the filetype for android but just trying iOS for now...

uploadVideo() {
    const file = {
      uri: this.props.video.path,
      name: 'react-test-1.mov',
      type: 'video/quicktime'
    };
    let prefixPlatform = 'droid_';
    if (Platform.OS === 'ios') {
      prefixPlatform = 'ios_';
    }
    const options = {
      keyPrefix: prefixPlatform,
      bucket: 'uploads',
      region: 'us-east-1',
      accessKey: '<my_key>',
      secretKey: '<my_secret>',
      successActionStatus: 201
    };
    RNS3.put(file, options)
    .then(response => {
      if (response.status !== 201) {
        console.log('error uploading to S3');
      } else {
        console.log(response.body);
      }
    })
    .progress((e) => {
      console.log(e.loaded / e.total);
        this.updateProgress((e.loaded / e.total));
      }
    )
    .catch((err) => {
      console.log(err);
    });
  }

The progress updates in the console, and all looks well, but I get some sort of corruption in the video.

from react-native-aws3.

KristoferEng avatar KristoferEng commented on September 27, 2024

I have the same issue. Did you ever figure out a fix?

from react-native-aws3.

trops avatar trops commented on September 27, 2024

from react-native-aws3.

dbrill avatar dbrill commented on September 27, 2024

How is this issue closed?
Can we re-open this?

from react-native-aws3.

prameetc avatar prameetc commented on September 27, 2024

In the type pass video/mov and not video/quicktime.

from react-native-aws3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.