mardi 31 mars 2015

Cannot Load Video from S3 AWS( Android Studio )

I'm trying to load video from my S3 AWS service. The problem is that every time I try to load video, I'm getting:



D/MediaPlayer﹕ Couldn't open file on client side, trying server side

E/MediaPlayer﹕ error (1, -2147483648)

E/MediaPlayer﹕ Error (1,-2147483648)

D/VideoView﹕ Error: 1,-2147483648


I don't know if it's problem with permissions? This is my Android Code:



AWSCredentials myCredentials = new BasicAWSCredentials("my-key", "secret-key");
AmazonS3 s3client = new AmazonS3Client(myCredentials);
GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest("-", "AndroidCommercial.3gp");

objectURL = s3client.generatePresignedUrl(request);
videoview = (VideoView) findViewById(R.id.videoView);

getWindow().setFormat(PixelFormat.TRANSLUCENT);
MediaController mediaCtrl;
mediaCtrl = new MediaController( MainActivity.this );
mediaCtrl.setMediaPlayer(videoview);
videoview.setMediaController(mediaCtrl);
Uri clip = Uri.parse(String.valueOf(objectURL));
videoview.setVideoURI(clip);
videoview.requestFocus();

videoview.start();


I'm not sure if it's problem with AWS or my APP... I've created user with AmazonS3FullAccess policy. I can download that file with AWS chrome extension. Can anyone help me?


Best Regards, Mateusz





Aucun commentaire:

Enregistrer un commentaire