1
0
mirror of https://framagit.org/tom79/fedilab-tube synced 2025-02-16 12:00:42 +01:00

Some fixes

This commit is contained in:
Thomas 2020-12-28 15:39:18 +01:00
parent 325a239b86
commit 1cddf26c9a
3 changed files with 10 additions and 8 deletions

View File

@ -166,8 +166,8 @@ dependencies {
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0' implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
implementation 'com.github.GrenderG:Toasty:1.4.2' implementation 'com.github.GrenderG:Toasty:1.4.2'
implementation 'com.google.android.exoplayer:exoplayer:2.12.1' implementation 'com.google.android.exoplayer:exoplayer:2.12.2'
implementation 'com.google.android.exoplayer:extension-mediasession:2.12.1' implementation 'com.google.android.exoplayer:extension-mediasession:2.12.2'
implementation "com.github.mabbas007:TagsEditText:1.0.5" implementation "com.github.mabbas007:TagsEditText:1.0.5"
implementation "com.github.bumptech.glide:glide:4.11.0" implementation "com.github.bumptech.glide:glide:4.11.0"
annotationProcessor "com.github.bumptech.glide:compiler:4.11.0" annotationProcessor "com.github.bumptech.glide:compiler:4.11.0"

View File

@ -10,7 +10,9 @@
--> -->
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

View File

@ -1318,11 +1318,11 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
} }
private void stream(VideoData.Video video, String resolution, boolean autoPlay, long position, Uri subtitles, String lang) { private void stream(VideoData.Video video, String localTorrentUrl, String resolution, boolean autoPlay, long position, Uri subtitles, String lang) {
String videoURL = video.getFileUrl(resolution, PeertubeActivity.this); String videoURL = localTorrentUrl == null ? video.getFileUrl(resolution, PeertubeActivity.this) : localTorrentUrl;
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE); SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
int video_cache = sharedpreferences.getInt(Helper.SET_VIDEO_CACHE, Helper.DEFAULT_VIDEO_CACHE_MB); int video_cache = sharedpreferences.getInt(Helper.SET_VIDEO_CACHE, Helper.DEFAULT_VIDEO_CACHE_MB);
if (videoURL != null && videoURL.endsWith(".torrent")) { if (videoURL != null && (videoURL.endsWith(".torrent") || videoURL.startsWith("magnet"))) {
torrentStream.startStream(videoURL); torrentStream.startStream(videoURL);
return; return;
} else { } else {
@ -1438,13 +1438,13 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
finish(); finish();
}); });
dialogBuilder.setPositiveButton(R.string.play, (dialog, id) -> { dialogBuilder.setPositiveButton(R.string.play, (dialog, id) -> {
stream(video, resolution, autoPlay, position, subtitles, lang); stream(video, null, resolution, autoPlay, position, subtitles, lang);
dialog.dismiss(); dialog.dismiss();
}); });
alertDialog = dialogBuilder.create(); alertDialog = dialogBuilder.create();
alertDialog.show(); alertDialog.show();
} else { } else {
stream(video, resolution, autoPlay, position, subtitles, lang); stream(video, torrentLocal, resolution, autoPlay, position, subtitles, lang);
} }