mirror of
https://framagit.org/tom79/fedilab-tube
synced 2025-06-05 21:09:11 +02:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
7fece740af | |||
857ab65f93 | |||
807655da5b | |||
a77f37e564 | |||
1194209c82 | |||
f31b6e9ac8 | |||
3353b7205b | |||
0f995cc615 |
@ -11,8 +11,8 @@ android {
|
||||
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 30
|
||||
versionCode 20
|
||||
versionName "1.5.1"
|
||||
versionCode 21
|
||||
versionName "1.5.2"
|
||||
multiDexEnabled true
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
@ -6,7 +6,16 @@
|
||||
<string name="set_video_language_choice" translatable="false">set_video_language_choice</string>
|
||||
<string name="set_video_quality_choice" translatable="false">set_video_quality_choice</string>
|
||||
<string name="set_video_cache_choice" translatable="false">set_video_cache_choice</string>
|
||||
<string name="set_autoplay_choice" translatable="false">set_autoplay_choice</string>
|
||||
<string name="set_theme_choice" translatable="false">set_theme_choice</string>
|
||||
<string name="set_fullscreen_choice" translatable="false">set_fullscreen_choice</string>
|
||||
|
||||
|
||||
<string name="set_autoplay">Lecture automatique</string>
|
||||
<string name="set_autoplay_description">Si activé, les vidéos seront lues automatiquement</string>
|
||||
|
||||
<string name="set_fullscreen">Plein écran</string>
|
||||
<string name="set_fullscreen_description">Ouvre automatiquement les vidéos en plein écran</string>
|
||||
|
||||
<string name="delete_account_comment">Supprimer tous les commentaires</string>
|
||||
<string name="delete_account_comment_confirm">Etes-vous sûr de vouloir supprimer tous les commentaires de ce compte pour vos vidéos ?</string>
|
||||
|
@ -1,3 +1,5 @@
|
||||
- Theme: Clair, Sombre et automatique
|
||||
- Supprimer tous les commentaires d'un compte sur vos vidéos
|
||||
- Mettre en sourdine un compte depuis les commentaires.
|
||||
- Nouvelles options :
|
||||
- Mode plein écran automatique
|
||||
- Désactiver la lecture automatique des vidéos
|
||||
|
||||
- Quelques corrections de bugs
|
@ -1 +1,8 @@
|
||||
- Fix some issues
|
||||
Added:
|
||||
- Enable/disable auto playback
|
||||
- Enter in fullscreen automatically (default disabled)
|
||||
- Back press pauses the video in fullscreen
|
||||
|
||||
Fixes:
|
||||
- Public timelines don't honor muted accounts
|
||||
- Comments are not removed when switching to a video without comments
|
@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="set_autoplay">Automatic playback</string>
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="add_public_reply">Add a public reply</string>
|
||||
<plurals name="number_of_replies">
|
||||
<item quantity="zero">%d ردود</item>
|
||||
|
@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="set_autoplay">Automatic playback</string>
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="add_public_reply">Öffentliche Antwort hinzufügen</string>
|
||||
<plurals name="number_of_replies">
|
||||
<item quantity="one">%d Antwort</item>
|
||||
|
@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="set_autoplay">Automatic playback</string>
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="add_public_reply">Προσθήκη δημόσιας απάντησης</string>
|
||||
<plurals name="number_of_replies">
|
||||
<item quantity="one">%d απάντηση</item>
|
||||
|
@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="set_autoplay">Automatic playback</string>
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="add_public_reply">Añade una respuesta pública</string>
|
||||
<plurals name="number_of_replies">
|
||||
<item quantity="one">%d respuesta</item>
|
||||
|
@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="set_autoplay">Automatic playback</string>
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="add_public_reply">Ajouter une réponse publique</string>
|
||||
<plurals name="number_of_replies">
|
||||
<item quantity="one">%d réponse</item>
|
||||
|
@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="set_autoplay">Automatic playback</string>
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="add_public_reply">Aggiungere una risposta pubblica</string>
|
||||
<plurals name="number_of_replies">
|
||||
<item quantity="one">%d risposta</item>
|
||||
|
@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="set_autoplay">Automatic playback</string>
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="add_public_reply">Add a public reply</string>
|
||||
<plurals name="number_of_replies">
|
||||
<item quantity="other">%d が返信</item>
|
||||
|
@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="set_autoplay">Automatic playback</string>
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="add_public_reply">Add a public reply</string>
|
||||
<plurals name="number_of_replies">
|
||||
<item quantity="other">답글 %d개</item>
|
||||
|
@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="set_autoplay">Automatic playback</string>
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="add_public_reply">Voeg een openbaar antwoord toe</string>
|
||||
<plurals name="number_of_replies">
|
||||
<item quantity="one">%d antwoord</item>
|
||||
|
@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="set_autoplay">Automatic playback</string>
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="add_public_reply">Dodaj publiczną odpowiedź</string>
|
||||
<plurals name="number_of_replies">
|
||||
<item quantity="one">%d odpowiedź</item>
|
||||
|
@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="set_autoplay">Automatic playback</string>
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="add_public_reply">Add a public reply</string>
|
||||
<plurals name="number_of_replies">
|
||||
<item quantity="one">%d resposta</item>
|
||||
|
@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="set_autoplay">Automatic playback</string>
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="add_public_reply">Add a public reply</string>
|
||||
<plurals name="number_of_replies">
|
||||
<item quantity="one">%d răspuns</item>
|
||||
|
@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="set_autoplay">Automatic playback</string>
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="add_public_reply">Добавить публичный ответ</string>
|
||||
<plurals name="number_of_replies">
|
||||
<item quantity="one">%d ответ</item>
|
||||
|
@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="set_autoplay">Automatic playback</string>
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="add_public_reply">Add a public reply</string>
|
||||
<plurals name="number_of_replies">
|
||||
<item quantity="one">%d svar</item>
|
||||
|
@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="set_autoplay">Automatic playback</string>
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="add_public_reply">添加公开回复</string>
|
||||
<plurals name="number_of_replies">
|
||||
<item quantity="other">%d 条回复</item>
|
||||
|
@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="set_autoplay">Automatic playback</string>
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="add_public_reply">Add a public reply</string>
|
||||
<plurals name="number_of_replies">
|
||||
<item quantity="other">%d 條回覆</item>
|
||||
|
@ -5,10 +5,20 @@
|
||||
<string name="set_video_language_choice" translatable="false">set_video_language_choice</string>
|
||||
<string name="set_video_quality_choice" translatable="false">set_video_quality_choice</string>
|
||||
<string name="set_video_cache_choice" translatable="false">set_video_cache_choice</string>
|
||||
<string name="set_autoplay_choice" translatable="false">set_autoplay_choice</string>
|
||||
<string name="set_theme_choice" translatable="false">set_theme_choice</string>
|
||||
<string name="set_fullscreen_choice" translatable="false">set_fullscreen_choice</string>
|
||||
|
||||
|
||||
<string name="set_autoplay">Automatic playback</string>
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
|
||||
<string name="add_public_reply">Add a public reply</string>
|
||||
|
||||
|
||||
<plurals name="number_of_replies">
|
||||
<item quantity="one">%d reply</item>
|
||||
<item quantity="other">%d replies</item>
|
||||
|
@ -41,6 +41,7 @@ import com.kobakei.ratethisapp.RateThisApp;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
@ -246,6 +247,13 @@ public class MainActivity extends AppCompatActivity {
|
||||
} else {
|
||||
navView.inflateMenu(R.menu.bottom_nav_menu);
|
||||
}
|
||||
peertubeInformation = new PeertubeInformation();
|
||||
peertubeInformation.setCategories(new LinkedHashMap<>());
|
||||
peertubeInformation.setLanguages(new LinkedHashMap<>());
|
||||
peertubeInformation.setLicences(new LinkedHashMap<>());
|
||||
peertubeInformation.setPrivacies(new LinkedHashMap<>());
|
||||
peertubeInformation.setPlaylistPrivacies(new LinkedHashMap<>());
|
||||
peertubeInformation.setTranslations(new LinkedHashMap<>());
|
||||
startInForeground();
|
||||
|
||||
if (BuildConfig.google_restriction && BuildConfig.full_instances) {
|
||||
|
@ -18,6 +18,7 @@ import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.app.PictureInPictureParams;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@ -47,6 +48,7 @@ import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.EditText;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
@ -145,7 +147,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
private VideoData.Video peertube;
|
||||
private int mode;
|
||||
private Map<String, List<PlaylistExist>> playlists;
|
||||
private boolean playInMinimized;
|
||||
private boolean playInMinimized, autoPlay, autoFullscreen;
|
||||
private boolean onStopCalled;
|
||||
private List<Caption> captions;
|
||||
private String max_id;
|
||||
@ -220,8 +222,10 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
binding.writeCommentContainer.setVisibility(View.GONE);
|
||||
}
|
||||
playInMinimized = sharedpreferences.getBoolean(getString(R.string.set_video_minimize_choice), true);
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N
|
||||
&& !getPackageManager().hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE)) {
|
||||
autoPlay = sharedpreferences.getBoolean(getString(R.string.set_autoplay_choice), true);
|
||||
autoFullscreen = sharedpreferences.getBoolean(getString(R.string.set_fullscreen_choice), false);
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O
|
||||
|| !getPackageManager().hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE)) {
|
||||
playInMinimized = false;
|
||||
}
|
||||
|
||||
@ -304,6 +308,10 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
playVideo();
|
||||
}
|
||||
registBroadcastReceiver();
|
||||
if( autoFullscreen && autoPlay) {
|
||||
openFullscreenDialog();
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -382,23 +390,35 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
if (b != null) {
|
||||
peertubeInstance = b.getString("peertube_instance", Helper.getLiveInstance(PeertubeActivity.this));
|
||||
videoUuid = b.getString("video_uuid", null);
|
||||
if( comments != null && comments.size() > 0) {
|
||||
int number = comments.size();
|
||||
comments.clear();
|
||||
commentListAdapter.notifyItemRangeRemoved(0, number);
|
||||
}
|
||||
playVideo();
|
||||
}
|
||||
}
|
||||
|
||||
private void playVideo() {
|
||||
if (player != null) {
|
||||
player.setPlayWhenReady(false);
|
||||
player.release();
|
||||
player = ExoPlayerFactory.newSimpleInstance(PeertubeActivity.this);
|
||||
binding.mediaVideo.setPlayer(player);
|
||||
binding.loader.setVisibility(View.GONE);
|
||||
player.setPlayWhenReady(true);
|
||||
player.setPlayWhenReady(autoPlay);
|
||||
captions = null;
|
||||
}
|
||||
if( autoFullscreen && autoPlay) {
|
||||
fullscreen = FullScreenMediaController.fullscreen.ON;
|
||||
setFullscreen(FullScreenMediaController.fullscreen.ON);
|
||||
fullScreenMode = true;
|
||||
openFullscreenDialog();
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||
} else {
|
||||
fullscreen = FullScreenMediaController.fullscreen.OFF;
|
||||
setFullscreen(FullScreenMediaController.fullscreen.OFF);
|
||||
fullScreenMode = false;
|
||||
}
|
||||
|
||||
binding.peertubePlaylist.setVisibility(View.VISIBLE);
|
||||
binding.peertubeBookmark.setVisibility(View.GONE);
|
||||
@ -547,8 +567,9 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
binding.writeCommentContainerReply.setVisibility(View.VISIBLE);
|
||||
binding.writeCommentContainer.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
binding.peertubeComments.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
binding.peertubeComments.setVisibility(View.GONE);
|
||||
binding.writeCommentContainerReply.setVisibility(View.GONE);
|
||||
binding.writeCommentContainer.setVisibility(View.GONE);
|
||||
binding.noActionText.setText(getString(R.string.comment_no_allowed_peertube));
|
||||
@ -648,7 +669,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
.createMediaSource(Uri.parse(apiResponse.getPeertubes().get(0).getStreamingPlaylists().get(0).getPlaylistUrl()));
|
||||
player.prepare(hlsMediaSource);
|
||||
}
|
||||
player.setPlayWhenReady(true);
|
||||
player.setPlayWhenReady(autoPlay);
|
||||
}
|
||||
|
||||
|
||||
@ -846,7 +867,6 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
super.onDestroy();
|
||||
binding = null;
|
||||
if (player != null) {
|
||||
player.setPlayWhenReady(false);
|
||||
player.release();
|
||||
}
|
||||
unregisterReceiver();
|
||||
@ -905,7 +925,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
}
|
||||
|
||||
private void enterVideoMode() {
|
||||
if (playInMinimized && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && player != null) {
|
||||
if (playInMinimized && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && player != null) {
|
||||
isPlayInMinimized = true;
|
||||
MediaSessionCompat mediaSession = new MediaSessionCompat(this, getPackageName());
|
||||
MediaSessionConnector mediaSessionConnector = new MediaSessionConnector(mediaSession);
|
||||
@ -914,7 +934,8 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
controlView.hide();
|
||||
binding.mediaVideo.setControllerAutoShow(false);
|
||||
mediaSession.setActive(true);
|
||||
enterPictureInPictureMode();
|
||||
PictureInPictureParams params = new PictureInPictureParams.Builder().build();
|
||||
enterPictureInPictureMode(params);
|
||||
}
|
||||
}
|
||||
|
||||
@ -957,7 +978,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
super.onResume();
|
||||
onStopCalled = false;
|
||||
if (player != null && !player.isPlaying()) {
|
||||
player.setPlayWhenReady(true);
|
||||
player.setPlayWhenReady(autoPlay);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1017,8 +1038,15 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
|
||||
fullScreenDialog = new Dialog(this, android.R.style.Theme_Black_NoTitleBar_Fullscreen) {
|
||||
public void onBackPressed() {
|
||||
if (fullScreenMode) {
|
||||
if( player != null && player.isPlaying() && fullScreenMode) {
|
||||
player.setPlayWhenReady(false);
|
||||
return;
|
||||
}
|
||||
if( fullScreenMode) {
|
||||
closeFullscreenDialog();
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
||||
Handler handler = new Handler();
|
||||
handler.postDelayed(() -> setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR), 2000);
|
||||
}
|
||||
super.onBackPressed();
|
||||
}
|
||||
@ -1167,6 +1195,14 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
|
||||
}
|
||||
});
|
||||
ImageButton playButton = controlView.findViewById(R.id.exo_play);
|
||||
playButton.setOnClickListener(v->{
|
||||
if(autoFullscreen && !fullScreenMode) {
|
||||
openFullscreenDialog();
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||
}
|
||||
player.setPlayWhenReady(true);
|
||||
});
|
||||
}
|
||||
|
||||
private void initResolution() {
|
||||
@ -1210,7 +1246,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
}
|
||||
|
||||
public void manageVIewPlaylists(APIResponse apiResponse) {
|
||||
if (apiResponse.getError() != null) {
|
||||
if (apiResponse == null || apiResponse.getError() != null || playlists == null || peertube == null) {
|
||||
return;
|
||||
}
|
||||
if (apiResponse.getPlaylists() != null && apiResponse.getPlaylists().size() > 0) {
|
||||
|
@ -121,23 +121,23 @@ public interface PeertubeService {
|
||||
|
||||
//Overview videos
|
||||
@GET("overviews/videos")
|
||||
Call<OverviewVideo> getOverviewVideos(@Query("page") String page, @Query("languageOneOf") List<String> languageOneOf);
|
||||
Call<OverviewVideo> getOverviewVideos(@Header("Authorization") String credentials, @Query("page") String page, @Query("languageOneOf") List<String> languageOneOf);
|
||||
|
||||
//Most liked videos
|
||||
@GET("videos?sort=-likes")
|
||||
Call<VideoData> getMostLikedVideos(@Query("start") String maxId, @Query("count") String count, @Query("languageOneOf") List<String> languageOneOf);
|
||||
Call<VideoData> getMostLikedVideos(@Header("Authorization") String credentials, @Query("start") String maxId, @Query("count") String count, @Query("languageOneOf") List<String> languageOneOf);
|
||||
|
||||
//Most liked videos
|
||||
//Trending videos
|
||||
@GET("videos?sort=-trending")
|
||||
Call<VideoData> getTrendingVideos(@Query("start") String maxId, @Query("count") String count, @Query("languageOneOf") List<String> languageOneOf);
|
||||
Call<VideoData> getTrendingVideos(@Header("Authorization") String credentials, @Query("start") String maxId, @Query("count") String count, @Query("languageOneOf") List<String> languageOneOf);
|
||||
|
||||
//Recently added videos
|
||||
@GET("videos?sort=-publishedAt")
|
||||
Call<VideoData> getRecentlyAddedVideos(@Query("start") String maxId, @Query("count") String count, @Query("languageOneOf") List<String> languageOneOf);
|
||||
Call<VideoData> getRecentlyAddedVideos(@Header("Authorization") String credentials, @Query("start") String maxId, @Query("count") String count, @Query("languageOneOf") List<String> languageOneOf);
|
||||
|
||||
//Local videos
|
||||
@GET("videos?sort=-publishedAt&filter=local")
|
||||
Call<VideoData> getLocalVideos(@Query("start") String maxId, @Query("count") String count, @Query("languageOneOf") List<String> languageOneOf);
|
||||
Call<VideoData> getLocalVideos(@Header("Authorization") String credentials, @Query("start") String maxId, @Query("count") String count, @Query("languageOneOf") List<String> languageOneOf);
|
||||
|
||||
//History
|
||||
@GET("users/me/history/videos")
|
||||
@ -145,7 +145,7 @@ public interface PeertubeService {
|
||||
|
||||
//Search
|
||||
@GET("search/videos")
|
||||
Call<VideoData> searchVideos(@Query("search") String search, @Query("start") String maxId, @Query("count") String count);
|
||||
Call<VideoData> searchVideos(@Header("Authorization") String credentials, @Query("search") String search, @Query("start") String maxId, @Query("count") String count);
|
||||
|
||||
//Get notifications
|
||||
@GET("users/me/notifications")
|
||||
|
@ -161,7 +161,11 @@ public class RetrofitPeertubeAPI {
|
||||
}
|
||||
|
||||
private String getToken() {
|
||||
if( token != null) {
|
||||
return "Bearer " + token;
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private PeertubeService init() {
|
||||
@ -331,19 +335,19 @@ public class RetrofitPeertubeAPI {
|
||||
}
|
||||
break;
|
||||
case MOST_LIKED:
|
||||
videoCall = peertubeService.getMostLikedVideos(max_id, count, filter);
|
||||
videoCall = peertubeService.getMostLikedVideos(getToken(), max_id, count, filter);
|
||||
break;
|
||||
case LOCAL:
|
||||
videoCall = peertubeService.getLocalVideos(max_id, count, filter);
|
||||
videoCall = peertubeService.getLocalVideos(getToken(), max_id, count, filter);
|
||||
break;
|
||||
case TRENDING:
|
||||
videoCall = peertubeService.getTrendingVideos(max_id, count, filter);
|
||||
videoCall = peertubeService.getTrendingVideos(getToken(), max_id, count, filter);
|
||||
break;
|
||||
case HISTORY:
|
||||
videoCall = peertubeService.getHistory(getToken(), max_id, count);
|
||||
break;
|
||||
case RECENT:
|
||||
videoCall = peertubeService.getRecentlyAddedVideos(max_id, count, filter);
|
||||
videoCall = peertubeService.getRecentlyAddedVideos(getToken(), max_id, count, filter);
|
||||
break;
|
||||
}
|
||||
if (videoCall != null) {
|
||||
@ -374,7 +378,7 @@ public class RetrofitPeertubeAPI {
|
||||
APIResponse apiResponse = new APIResponse();
|
||||
PeertubeService peertubeService = init();
|
||||
ArrayList<String> filter = selection != null ? new ArrayList<>(selection) : null;
|
||||
Call<OverviewVideo> overviewVideoCall = peertubeService.getOverviewVideos(page, filter);
|
||||
Call<OverviewVideo> overviewVideoCall = peertubeService.getOverviewVideos(getToken(), page, filter);
|
||||
try {
|
||||
Response<OverviewVideo> response = overviewVideoCall.execute();
|
||||
if (response.isSuccessful() && response.body() != null) {
|
||||
@ -647,7 +651,7 @@ public class RetrofitPeertubeAPI {
|
||||
*/
|
||||
public APIResponse searchPeertube(String query, String max_id) {
|
||||
PeertubeService peertubeService = init();
|
||||
Call<VideoData> searchVideosCall = peertubeService.searchVideos(query, max_id, count);
|
||||
Call<VideoData> searchVideosCall = peertubeService.searchVideos(getToken(), query, max_id, count);
|
||||
APIResponse apiResponse = new APIResponse();
|
||||
try {
|
||||
Response<VideoData> response = searchVideosCall.execute();
|
||||
|
@ -137,6 +137,16 @@ public class SettingsFragment extends PreferenceFragmentCompat implements Shared
|
||||
assert set_video_minimize_choice != null;
|
||||
editor.putBoolean(getString(R.string.set_video_minimize_choice), set_video_minimize_choice.isChecked());
|
||||
}
|
||||
if (key.compareTo(getString(R.string.set_autoplay_choice)) == 0) {
|
||||
SwitchPreference set_autoplay_choice = findPreference(getString(R.string.set_autoplay_choice));
|
||||
assert set_autoplay_choice != null;
|
||||
editor.putBoolean(getString(R.string.set_autoplay_choice), set_autoplay_choice.isChecked());
|
||||
}
|
||||
if (key.compareTo(getString(R.string.set_fullscreen_choice)) == 0) {
|
||||
SwitchPreference set_fullscreen_choice = findPreference(getString(R.string.set_fullscreen_choice));
|
||||
assert set_fullscreen_choice != null;
|
||||
editor.putBoolean(getString(R.string.set_fullscreen_choice), set_fullscreen_choice.isChecked());
|
||||
}
|
||||
if (key.compareTo(getString(R.string.set_video_language_choice)) == 0) {
|
||||
MultiSelectListPreference set_video_language_choice = findPreference(getString(R.string.set_video_language_choice));
|
||||
assert set_video_language_choice != null;
|
||||
@ -208,12 +218,27 @@ public class SettingsFragment extends PreferenceFragmentCompat implements Shared
|
||||
assert set_video_cache_choice != null;
|
||||
set_video_cache_choice.setValue(video_cache / 10);
|
||||
|
||||
//****** Minimized videos *******
|
||||
boolean minimized = sharedpref.getBoolean(getString(R.string.set_video_minimize_choice), true);
|
||||
SwitchPreference set_video_minimize_choice = findPreference(getString(R.string.set_video_minimize_choice));
|
||||
assert set_video_minimize_choice != null;
|
||||
set_video_minimize_choice.setChecked(minimized);
|
||||
|
||||
|
||||
//****** Autoplay videos *******
|
||||
boolean autoplay = sharedpref.getBoolean(getString(R.string.set_autoplay_choice), true);
|
||||
SwitchPreference set_autoplay_choice = findPreference(getString(R.string.set_autoplay_choice));
|
||||
assert set_autoplay_choice != null;
|
||||
set_autoplay_choice.setChecked(autoplay);
|
||||
|
||||
|
||||
//****** Fullscreen videos *******
|
||||
boolean fullscreen = sharedpref.getBoolean(getString(R.string.set_fullscreen_choice), false);
|
||||
SwitchPreference set_fullscreen_choice = findPreference(getString(R.string.set_fullscreen_choice));
|
||||
assert set_fullscreen_choice != null;
|
||||
set_fullscreen_choice.setChecked(fullscreen);
|
||||
|
||||
//****** Language filter *********
|
||||
LinkedHashMap<String, String> languages = new LinkedHashMap<>(peertubeInformation.getLanguages());
|
||||
List<CharSequence> entriesLanguages = new ArrayList<>();
|
||||
List<CharSequence> valuesLanguages = new ArrayList<>();
|
||||
|
@ -127,6 +127,7 @@ public class RetrieveInfoService extends Service implements NetworkStateReceiver
|
||||
@Override
|
||||
public void run() {
|
||||
EmojiHelper.fillMapEmoji(getApplicationContext());
|
||||
if( peertubeInformation == null || peertubeInformation.getCategories().size() == 0) {
|
||||
peertubeInformation = new PeertubeInformation();
|
||||
peertubeInformation.setCategories(new LinkedHashMap<>());
|
||||
peertubeInformation.setLanguages(new LinkedHashMap<>());
|
||||
@ -135,6 +136,7 @@ public class RetrieveInfoService extends Service implements NetworkStateReceiver
|
||||
peertubeInformation.setPlaylistPrivacies(new LinkedHashMap<>());
|
||||
peertubeInformation.setTranslations(new LinkedHashMap<>());
|
||||
peertubeInformation = new RetrofitPeertubeAPI(RetrieveInfoService.this).getPeertubeInformation();
|
||||
}
|
||||
stopForeground(true);
|
||||
}
|
||||
};
|
||||
|
10
app/src/main/res/drawable/ic_baseline_open_in_full_24.xml
Normal file
10
app/src/main/res/drawable/ic_baseline_open_in_full_24.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M21,11l0,-8l-8,0l3.29,3.29l-10,10l-3.29,-3.29l0,8l8,0l-3.29,-3.29l10,-10z"/>
|
||||
</vector>
|
10
app/src/main/res/drawable/ic_baseline_play_arrow_24.xml
Normal file
10
app/src/main/res/drawable/ic_baseline_play_arrow_24.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M8,5v14l11,-7z"/>
|
||||
</vector>
|
@ -21,6 +21,18 @@
|
||||
android:summary="@string/set_video_quality_description"
|
||||
android:title="@string/set_quality_mode" />
|
||||
|
||||
<androidx.preference.SwitchPreference
|
||||
android:icon="@drawable/ic_baseline_play_arrow_24"
|
||||
android:key="@string/set_autoplay_choice"
|
||||
android:summary="@string/set_autoplay_description"
|
||||
android:title="@string/set_autoplay" />
|
||||
|
||||
<androidx.preference.SwitchPreference
|
||||
android:icon="@drawable/ic_baseline_open_in_full_24"
|
||||
android:key="@string/set_fullscreen_choice"
|
||||
android:summary="@string/set_fullscreen_description"
|
||||
android:title="@string/set_fullscreen" />
|
||||
|
||||
<androidx.preference.SeekBarPreference
|
||||
android:icon="@drawable/ic_baseline_storage_24"
|
||||
android:defaultValue="10"
|
||||
|
Reference in New Issue
Block a user