test release
This commit is contained in:
parent
b083c85378
commit
aae6b52b0f
6 changed files with 24 additions and 7 deletions
|
@ -9,8 +9,8 @@ android {
|
||||||
applicationId "asgardius.page.s3manager"
|
applicationId "asgardius.page.s3manager"
|
||||||
minSdk 24
|
minSdk 24
|
||||||
targetSdk 33
|
targetSdk 33
|
||||||
versionCode 23
|
versionCode 24
|
||||||
versionName "0.1.21"
|
versionName "0.1.22"
|
||||||
setProperty("archivesBaseName", "s3-manager-$versionName")
|
setProperty("archivesBaseName", "s3-manager-$versionName")
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
|
@ -47,6 +47,7 @@ public class BucketSelect extends AppCompatActivity {
|
||||||
AWSCredentials myCredentials;
|
AWSCredentials myCredentials;
|
||||||
AmazonS3 s3client;
|
AmazonS3 s3client;
|
||||||
ProgressBar simpleProgressBar;
|
ProgressBar simpleProgressBar;
|
||||||
|
int videocache, videotime;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -56,6 +57,8 @@ public class BucketSelect extends AppCompatActivity {
|
||||||
password = getIntent().getStringExtra("password");
|
password = getIntent().getStringExtra("password");
|
||||||
location = getIntent().getStringExtra("region");
|
location = getIntent().getStringExtra("region");
|
||||||
pdfendpoint = getIntent().getStringExtra("pdfendpoint");
|
pdfendpoint = getIntent().getStringExtra("pdfendpoint");
|
||||||
|
videocache = getIntent().getIntExtra("videocache", 40);
|
||||||
|
videotime = getIntent().getIntExtra("videotime", 1);
|
||||||
prefix = "";
|
prefix = "";
|
||||||
setContentView(R.layout.activity_bucket_select);
|
setContentView(R.layout.activity_bucket_select);
|
||||||
region = Region.getRegion("us-east-1");
|
region = Region.getRegion("us-east-1");
|
||||||
|
@ -193,6 +196,8 @@ public class BucketSelect extends AppCompatActivity {
|
||||||
intent.putExtra("treelevel", treelevel);
|
intent.putExtra("treelevel", treelevel);
|
||||||
intent.putExtra("region", location);
|
intent.putExtra("region", location);
|
||||||
intent.putExtra("pdfendpoint", pdfendpoint);
|
intent.putExtra("pdfendpoint", pdfendpoint);
|
||||||
|
intent.putExtra("videocache", videocache);
|
||||||
|
intent.putExtra("videotime", videotime);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,8 +92,6 @@ public class MainActivity extends AppCompatActivity {
|
||||||
db.close();
|
db.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
System.out.println("videocache " + videocache);
|
|
||||||
System.out.println("videotime " + videotime);
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
|
@ -291,6 +289,8 @@ public class MainActivity extends AppCompatActivity {
|
||||||
intent.putExtra("password", password);
|
intent.putExtra("password", password);
|
||||||
intent.putExtra("region", location);
|
intent.putExtra("region", location);
|
||||||
intent.putExtra("pdfendpoint", pdfendpoint);
|
intent.putExtra("pdfendpoint", pdfendpoint);
|
||||||
|
intent.putExtra("videocache", videocache);
|
||||||
|
intent.putExtra("videotime", videotime);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,7 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
AWSCredentials myCredentials;
|
AWSCredentials myCredentials;
|
||||||
AmazonS3 s3client;
|
AmazonS3 s3client;
|
||||||
ProgressBar simpleProgressBar;
|
ProgressBar simpleProgressBar;
|
||||||
|
int videocache, videotime;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -62,6 +63,8 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
pdfendpoint = getIntent().getStringExtra("pdfendpoint");
|
pdfendpoint = getIntent().getStringExtra("pdfendpoint");
|
||||||
prefix = getIntent().getStringExtra("prefix");
|
prefix = getIntent().getStringExtra("prefix");
|
||||||
treelevel = getIntent().getIntExtra("treelevel", 0);
|
treelevel = getIntent().getIntExtra("treelevel", 0);
|
||||||
|
videocache = getIntent().getIntExtra("videocache", 40);
|
||||||
|
videotime = getIntent().getIntExtra("videotime", 1);
|
||||||
setContentView(R.layout.activity_object_select);
|
setContentView(R.layout.activity_object_select);
|
||||||
getSupportActionBar().setTitle(bucket+"/"+prefix);
|
getSupportActionBar().setTitle(bucket+"/"+prefix);
|
||||||
region = Region.getRegion(location);
|
region = Region.getRegion(location);
|
||||||
|
@ -287,7 +290,7 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
Calendar mycal = Calendar.getInstance();
|
Calendar mycal = Calendar.getInstance();
|
||||||
mycal.setTime(expiration);
|
mycal.setTime(expiration);
|
||||||
//System.out.println("today is " + mycal.getTime());
|
//System.out.println("today is " + mycal.getTime());
|
||||||
mycal.add(Calendar.HOUR, 6);
|
mycal.add(Calendar.HOUR, videotime);
|
||||||
//System.out.println("Expiration date: " + mycal.getTime());
|
//System.out.println("Expiration date: " + mycal.getTime());
|
||||||
expiration = mycal.getTime();
|
expiration = mycal.getTime();
|
||||||
GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucket, prefix + Name.get(position).toString()).withExpiration(expiration);;
|
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 intent = new Intent(this, VideoPlayer.class);
|
||||||
intent.putExtra("video_url", url);
|
intent.putExtra("video_url", url);
|
||||||
|
intent.putExtra("videocache", videocache);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -444,6 +448,8 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
intent.putExtra("treelevel", treelevel+1);
|
intent.putExtra("treelevel", treelevel+1);
|
||||||
intent.putExtra("region", location);
|
intent.putExtra("region", location);
|
||||||
intent.putExtra("pdfendpoint", pdfendpoint);
|
intent.putExtra("pdfendpoint", pdfendpoint);
|
||||||
|
intent.putExtra("videocache", videocache);
|
||||||
|
intent.putExtra("videotime", videotime);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -459,6 +465,7 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
intent.putExtra("object", object);
|
intent.putExtra("object", object);
|
||||||
intent.putExtra("region", location);
|
intent.putExtra("region", location);
|
||||||
intent.putExtra("mediafile", mediafile);
|
intent.putExtra("mediafile", mediafile);
|
||||||
|
intent.putExtra("videotime", videotime);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ public class Share extends AppCompatActivity {
|
||||||
GeneratePresignedUrlRequest request;
|
GeneratePresignedUrlRequest request;
|
||||||
Date expiration;
|
Date expiration;
|
||||||
URL objectURL;
|
URL objectURL;
|
||||||
|
int videotime;
|
||||||
|
|
||||||
public static String URLify(String str) {
|
public static String URLify(String str) {
|
||||||
str = str.trim();
|
str = str.trim();
|
||||||
|
@ -85,6 +86,7 @@ public class Share extends AppCompatActivity {
|
||||||
location = getIntent().getStringExtra("region");
|
location = getIntent().getStringExtra("region");
|
||||||
object = getIntent().getStringExtra("object");
|
object = getIntent().getStringExtra("object");
|
||||||
mediafile = getIntent().getBooleanExtra("mediafile", false);
|
mediafile = getIntent().getBooleanExtra("mediafile", false);
|
||||||
|
videotime = getIntent().getIntExtra("videotime", 1);
|
||||||
region = Region.getRegion(location);
|
region = Region.getRegion(location);
|
||||||
s3ClientOptions = S3ClientOptions.builder().build();
|
s3ClientOptions = S3ClientOptions.builder().build();
|
||||||
myCredentials = new BasicAWSCredentials(username, password);
|
myCredentials = new BasicAWSCredentials(username, password);
|
||||||
|
@ -144,7 +146,7 @@ public class Share extends AppCompatActivity {
|
||||||
expiration = new Date();
|
expiration = new Date();
|
||||||
mycal.setTime(expiration);
|
mycal.setTime(expiration);
|
||||||
//System.out.println("today is " + mycal.getTime());
|
//System.out.println("today is " + mycal.getTime());
|
||||||
mycal.add(Calendar.HOUR, 6);
|
mycal.add(Calendar.HOUR, videotime);
|
||||||
//System.out.println("Expiration date: " + mycal.getTime());
|
//System.out.println("Expiration date: " + mycal.getTime());
|
||||||
expiration = mycal.getTime();
|
expiration = mycal.getTime();
|
||||||
request = new GeneratePresignedUrlRequest(bucket, object).withExpiration(expiration);
|
request = new GeneratePresignedUrlRequest(bucket, object).withExpiration(expiration);
|
||||||
|
|
|
@ -35,8 +35,9 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
private WifiManager.WifiLock mWifiLock;
|
private WifiManager.WifiLock mWifiLock;
|
||||||
private PowerManager.WakeLock mWakeLock;
|
private PowerManager.WakeLock mWakeLock;
|
||||||
private PowerManager powerManager;
|
private PowerManager powerManager;
|
||||||
private long maxCacheSize = 1024 * 1024 * 1024;
|
private long maxCacheSize;
|
||||||
SimpleCache simpleCache;
|
SimpleCache simpleCache;
|
||||||
|
int videocache;
|
||||||
|
|
||||||
ExoPlayer player;
|
ExoPlayer player;
|
||||||
|
|
||||||
|
@ -50,6 +51,8 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Transistor:wake_lock");
|
mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Transistor:wake_lock");
|
||||||
//Get media url
|
//Get media url
|
||||||
String videoURL = getIntent().getStringExtra("video_url");
|
String videoURL = getIntent().getStringExtra("video_url");
|
||||||
|
videocache = getIntent().getIntExtra("videocache", 40);
|
||||||
|
maxCacheSize = (long)videocache * 1024 * 1024;
|
||||||
playerView = findViewById(R.id.player_view);
|
playerView = findViewById(R.id.player_view);
|
||||||
// creating a variable for exoplayer
|
// creating a variable for exoplayer
|
||||||
player = new ExoPlayer.Builder(this).build();
|
player = new ExoPlayer.Builder(this).build();
|
||||||
|
|
Loading…
Reference in a new issue