From 46fad327d023bf7f5a12efa10412118eb58f87e7 Mon Sep 17 00:00:00 2001 From: Page Asgardius Date: Fri, 2 Sep 2022 12:32:02 -0700 Subject: [PATCH] update strings file --- .../asgardius/page/s3manager/ObjectSelect.java | 14 ++++++++++++++ app/src/main/res/values/strings.xml | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/asgardius/page/s3manager/ObjectSelect.java b/app/src/main/java/asgardius/page/s3manager/ObjectSelect.java index 11ad896..9ebe010 100644 --- a/app/src/main/java/asgardius/page/s3manager/ObjectSelect.java +++ b/app/src/main/java/asgardius/page/s3manager/ObjectSelect.java @@ -6,6 +6,7 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Toast; @@ -17,11 +18,13 @@ import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.AmazonS3Client; import com.amazonaws.services.s3.S3ClientOptions; import com.amazonaws.services.s3.model.Bucket; +import com.amazonaws.services.s3.model.GeneratePresignedUrlRequest; import com.amazonaws.services.s3.model.ListObjectsV2Result; import com.amazonaws.services.s3.model.ObjectListing; import com.amazonaws.services.s3.model.S3Object; import com.amazonaws.services.s3.model.S3ObjectSummary; +import java.net.URL; import java.util.ArrayList; import java.util.List; @@ -116,6 +119,9 @@ public class ObjectSelect extends AppCompatActivity { public void onClick(View view, int position) { System.out.println("Click on "+Name.get(position).toString()); //explorer(Name.get(position).toString()); + GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucket, Name.get(position).toString()); + URL objectURL = s3client.generatePresignedUrl(request); + videoplayer(objectURL.toString()); } @Override @@ -124,4 +130,12 @@ public class ObjectSelect extends AppCompatActivity { } })); } + + private void videoplayer(String url) { + + Intent intent = new Intent(this, VideoPlayer.class); + intent.putExtra("video_url", url); + startActivity(intent); + + } } \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e73d315..cce6bc5 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,7 +1,7 @@ Asgardius S3 Manager VideoPlayer - + https://object.asgardius.company asgardius DTMp5kftamr49Ke7