call = service.getVideosData(start, count, sort, nsfw);
@@ -277,26 +279,27 @@ public class VideoListActivity extends AppCompatActivity {
/**
* Force android to not use SSLv3
- *
- * @param callingActivity Activity
+ *
+ * // * @param callingActivity Activity
*/
- private void updateAndroidSecurityProvider(Activity callingActivity) {
- try {
- ProviderInstaller.installIfNeeded(this);
- } catch (GooglePlayServicesRepairableException e) {
- // Thrown when Google Play Services is not installed, up-to-date, or enabled
- // Show dialog to allow users to install, update, or otherwise enable Google Play services.
- GooglePlayServicesUtil.getErrorDialog(e.getConnectionStatusCode(), callingActivity, 0);
- } catch (GooglePlayServicesNotAvailableException e) {
- Log.e("SecurityException", "Google Play Services not available.");
- }
- }
-
+// private void updateAndroidSecurityProvider(Activity callingActivity) {
+// try {
+// ProviderInstaller.installIfNeeded(this);
+// } catch (GooglePlayServicesRepairableException e) {
+// // Thrown when Google Play Services is not installed, up-to-date, or enabled
+// // Show dialog to allow users to install, update, or otherwise enable Google Play services.
+// GooglePlayServicesUtil.getErrorDialog(e.getConnectionStatusCode(), callingActivity, 0);
+// } catch (GooglePlayServicesNotAvailableException e) {
+// Log.e("SecurityException", "Google Play Services not available.");
+// }
+// }
@Override
protected void onResume() {
super.onResume();
-
- if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
+ // only check when we actually need the permission
+ SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
+ if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED &&
+ sharedPref.getBoolean("pref_torrent_player", false)) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 0);
}
}
diff --git a/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java b/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java
index 46e58e5..5d8f94e 100644
--- a/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java
+++ b/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java
@@ -15,7 +15,6 @@ import android.view.Surface;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
-import android.widget.FrameLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
@@ -93,8 +92,8 @@ public class VideoPlayActivity extends AppCompatActivity implements VideoRendere
simpleExoPlayerView.setPlayer(player);
// get video details from api
- String apiBaseURL = APIUrlHelper.getUrl(this);
- GetVideoDataService service = RetrofitInstance.getRetrofitInstance(apiBaseURL + "/api/v1/").create(GetVideoDataService.class);
+ String apiBaseURL = APIUrlHelper.getUrlWithVersion(this);
+ GetVideoDataService service = RetrofitInstance.getRetrofitInstance(apiBaseURL).create(GetVideoDataService.class);
Call