test release

This commit is contained in:
Page Asgardius 2022-10-06 10:24:22 -07:00
parent b083c85378
commit aae6b52b0f
6 changed files with 24 additions and 7 deletions

View file

@ -9,8 +9,8 @@ android {
applicationId "asgardius.page.s3manager"
minSdk 24
targetSdk 33
versionCode 23
versionName "0.1.21"
versionCode 24
versionName "0.1.22"
setProperty("archivesBaseName", "s3-manager-$versionName")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View file

@ -47,6 +47,7 @@ public class BucketSelect extends AppCompatActivity {
AWSCredentials myCredentials;
AmazonS3 s3client;
ProgressBar simpleProgressBar;
int videocache, videotime;
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -56,6 +57,8 @@ public class BucketSelect extends AppCompatActivity {
password = getIntent().getStringExtra("password");
location = getIntent().getStringExtra("region");
pdfendpoint = getIntent().getStringExtra("pdfendpoint");
videocache = getIntent().getIntExtra("videocache", 40);
videotime = getIntent().getIntExtra("videotime", 1);
prefix = "";
setContentView(R.layout.activity_bucket_select);
region = Region.getRegion("us-east-1");
@ -193,6 +196,8 @@ public class BucketSelect extends AppCompatActivity {
intent.putExtra("treelevel", treelevel);
intent.putExtra("region", location);
intent.putExtra("pdfendpoint", pdfendpoint);
intent.putExtra("videocache", videocache);
intent.putExtra("videotime", videotime);
startActivity(intent);
}

View file

@ -92,8 +92,6 @@ public class MainActivity extends AppCompatActivity {
db.close();
}
}
System.out.println("videocache " + videocache);
System.out.println("videotime " + videotime);
} catch (Exception e) {
e.printStackTrace();
runOnUiThread(new Runnable() {
@ -291,6 +289,8 @@ public class MainActivity extends AppCompatActivity {
intent.putExtra("password", password);
intent.putExtra("region", location);
intent.putExtra("pdfendpoint", pdfendpoint);
intent.putExtra("videocache", videocache);
intent.putExtra("videotime", videotime);
startActivity(intent);
}

View file

@ -50,6 +50,7 @@ public class ObjectSelect extends AppCompatActivity {
AWSCredentials myCredentials;
AmazonS3 s3client;
ProgressBar simpleProgressBar;
int videocache, videotime;
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -62,6 +63,8 @@ public class ObjectSelect extends AppCompatActivity {
pdfendpoint = getIntent().getStringExtra("pdfendpoint");
prefix = getIntent().getStringExtra("prefix");
treelevel = getIntent().getIntExtra("treelevel", 0);
videocache = getIntent().getIntExtra("videocache", 40);
videotime = getIntent().getIntExtra("videotime", 1);
setContentView(R.layout.activity_object_select);
getSupportActionBar().setTitle(bucket+"/"+prefix);
region = Region.getRegion(location);
@ -287,7 +290,7 @@ public class ObjectSelect extends AppCompatActivity {
Calendar mycal = Calendar.getInstance();
mycal.setTime(expiration);
//System.out.println("today is " + mycal.getTime());
mycal.add(Calendar.HOUR, 6);
mycal.add(Calendar.HOUR, videotime);
//System.out.println("Expiration date: " + mycal.getTime());
expiration = mycal.getTime();
GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucket, prefix + Name.get(position).toString()).withExpiration(expiration);;
@ -404,6 +407,7 @@ public class ObjectSelect extends AppCompatActivity {
Intent intent = new Intent(this, VideoPlayer.class);
intent.putExtra("video_url", url);
intent.putExtra("videocache", videocache);
startActivity(intent);
}
@ -444,6 +448,8 @@ public class ObjectSelect extends AppCompatActivity {
intent.putExtra("treelevel", treelevel+1);
intent.putExtra("region", location);
intent.putExtra("pdfendpoint", pdfendpoint);
intent.putExtra("videocache", videocache);
intent.putExtra("videotime", videotime);
startActivity(intent);
}
@ -459,6 +465,7 @@ public class ObjectSelect extends AppCompatActivity {
intent.putExtra("object", object);
intent.putExtra("region", location);
intent.putExtra("mediafile", mediafile);
intent.putExtra("videotime", videotime);
startActivity(intent);
}

View file

@ -36,6 +36,7 @@ public class Share extends AppCompatActivity {
GeneratePresignedUrlRequest request;
Date expiration;
URL objectURL;
int videotime;
public static String URLify(String str) {
str = str.trim();
@ -85,6 +86,7 @@ public class Share extends AppCompatActivity {
location = getIntent().getStringExtra("region");
object = getIntent().getStringExtra("object");
mediafile = getIntent().getBooleanExtra("mediafile", false);
videotime = getIntent().getIntExtra("videotime", 1);
region = Region.getRegion(location);
s3ClientOptions = S3ClientOptions.builder().build();
myCredentials = new BasicAWSCredentials(username, password);
@ -144,7 +146,7 @@ public class Share extends AppCompatActivity {
expiration = new Date();
mycal.setTime(expiration);
//System.out.println("today is " + mycal.getTime());
mycal.add(Calendar.HOUR, 6);
mycal.add(Calendar.HOUR, videotime);
//System.out.println("Expiration date: " + mycal.getTime());
expiration = mycal.getTime();
request = new GeneratePresignedUrlRequest(bucket, object).withExpiration(expiration);

View file

@ -35,8 +35,9 @@ public class VideoPlayer extends AppCompatActivity {
private WifiManager.WifiLock mWifiLock;
private PowerManager.WakeLock mWakeLock;
private PowerManager powerManager;
private long maxCacheSize = 1024 * 1024 * 1024;
private long maxCacheSize;
SimpleCache simpleCache;
int videocache;
ExoPlayer player;
@ -50,6 +51,8 @@ public class VideoPlayer extends AppCompatActivity {
mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Transistor:wake_lock");
//Get media url
String videoURL = getIntent().getStringExtra("video_url");
videocache = getIntent().getIntExtra("videocache", 40);
maxCacheSize = (long)videocache * 1024 * 1024;
playerView = findViewById(R.id.player_view);
// creating a variable for exoplayer
player = new ExoPlayer.Builder(this).build();