Thorium-android-app/app/src/main/java/net/schueller/peertube/fragment/VideoPlayerFragment.java

505 lines
16 KiB
Java
Raw Normal View History

2019-01-06 02:22:55 +01:00
/*
2020-11-28 22:36:47 +01:00
* Copyright (C) 2020 Stefan Schüller <sschueller@techdroid.com>
2019-01-06 02:22:55 +01:00
*
* This program is free software: you can redistribute it and/or modify
2020-11-28 22:36:47 +01:00
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
2019-01-06 02:22:55 +01:00
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2020-11-28 22:36:47 +01:00
* GNU Affero General Public License for more details.
2019-01-06 02:22:55 +01:00
*
2020-11-28 22:36:47 +01:00
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2019-01-06 02:22:55 +01:00
*/
2019-01-06 02:14:03 +01:00
package net.schueller.peertube.fragment;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.net.Uri;
import android.os.Build;
2019-01-06 02:14:03 +01:00
import android.os.Bundle;
import android.os.Environment;
import android.os.IBinder;
import android.preference.PreferenceManager;
import android.util.Log;
import android.view.GestureDetector;
2019-01-06 02:14:03 +01:00
import android.view.LayoutInflater;
import android.view.MotionEvent;
2019-01-06 02:14:03 +01:00
import android.view.Surface;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
2019-01-06 02:14:03 +01:00
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.github.se_bastiaan.torrentstream.StreamStatus;
import com.github.se_bastiaan.torrentstream.Torrent;
import com.github.se_bastiaan.torrentstream.TorrentOptions;
import com.github.se_bastiaan.torrentstream.TorrentStream;
import com.github.se_bastiaan.torrentstream.listeners.TorrentListener;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.decoder.DecoderCounters;
import com.google.android.exoplayer2.ui.AspectRatioFrameLayout;
import com.google.android.exoplayer2.ui.PlayerView;
import com.google.android.exoplayer2.util.Util;
import com.google.android.exoplayer2.video.VideoRendererEventListener;
import com.mikepenz.iconics.Iconics;
import net.schueller.peertube.R;
2019-01-06 02:28:13 +01:00
2019-01-06 02:14:03 +01:00
import net.schueller.peertube.helper.APIUrlHelper;
import net.schueller.peertube.helper.ErrorHelper;
2019-01-07 22:33:10 +01:00
import net.schueller.peertube.model.File;
2019-01-06 02:14:03 +01:00
import net.schueller.peertube.model.Video;
import net.schueller.peertube.network.GetVideoDataService;
import net.schueller.peertube.network.RetrofitInstance;
import net.schueller.peertube.service.VideoPlayerService;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
2019-01-06 02:14:03 +01:00
import androidx.fragment.app.Fragment;
2020-07-05 15:07:50 +02:00
2019-01-06 02:14:03 +01:00
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
2020-07-05 15:07:50 +02:00
import static net.schueller.peertube.helper.VideoHelper.canEnterPipMode;
2019-01-06 02:14:03 +01:00
public class VideoPlayerFragment extends Fragment implements VideoRendererEventListener {
private String mVideoUuid;
private ProgressBar progressBar;
private PlayerView simpleExoPlayerView;
private Intent videoPlayerIntent;
private Boolean mBound = false;
private Boolean isFullscreen = false;
private VideoPlayerService mService;
private TorrentStream torrentStream;
private LinearLayout torrentStatus;
private float aspectRatio;
2019-01-06 02:14:03 +01:00
private static final String TAG = "VideoPlayerFragment";
private GestureDetector mDetector;
2019-01-06 02:14:03 +01:00
private ServiceConnection mConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName className, IBinder service) {
Log.d(TAG, "onServiceConnected");
VideoPlayerService.LocalBinder binder = (VideoPlayerService.LocalBinder) service;
mService = binder.getService();
// 2. Create the player
simpleExoPlayerView.setPlayer(mService.player);
mBound = true;
loadVideo();
}
@Override
public void onServiceDisconnected(ComponentName componentName) {
Log.d(TAG, "onServiceDisconnected");
simpleExoPlayerView.setPlayer(null);
mBound = false;
}
};
private AspectRatioFrameLayout.AspectRatioListener aspectRatioListerner = new AspectRatioFrameLayout.AspectRatioListener()
{
@Override
public void onAspectRatioUpdated( float targetAspectRatio, float naturalAspectRatio, boolean aspectRatioMismatch )
{
aspectRatio = targetAspectRatio;
}
};
2019-01-06 02:14:03 +01:00
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_video_player, container, false);
}
public void start(String videoUuid) {
// start service
Context context = getContext();
Activity activity = getActivity();
mVideoUuid = videoUuid;
2019-01-06 02:28:13 +01:00
assert activity != null;
progressBar = activity.findViewById(R.id.torrent_progress);
2019-01-06 02:14:03 +01:00
progressBar.setMax(100);
2020-07-05 15:07:50 +02:00
assert context != null;
2019-01-06 02:14:03 +01:00
simpleExoPlayerView = new PlayerView(context);
simpleExoPlayerView = activity.findViewById(R.id.video_view);
simpleExoPlayerView.setControllerShowTimeoutMs(1000);
simpleExoPlayerView.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_FIT);
mDetector = new GestureDetector(context, new MyGestureListener());
simpleExoPlayerView.setOnTouchListener(touchListener);
simpleExoPlayerView.setAspectRatioListener( aspectRatioListerner );
torrentStatus = activity.findViewById(R.id.exo_torrent_status);
// Full screen Icon
2019-01-27 16:00:30 +01:00
TextView fullscreenText = activity.findViewById(R.id.exo_fullscreen);
FrameLayout fullscreenButton = activity.findViewById(R.id.exo_fullscreen_button);
fullscreenText.setText(R.string.video_expand_icon);
new Iconics.IconicsBuilder().ctx(context).on(fullscreenText).build();
fullscreenButton.setOnClickListener(view -> {
Log.d(TAG, "Fullscreen");
fullScreenToggle();
});
2019-01-06 02:14:03 +01:00
if (!mBound) {
videoPlayerIntent = new Intent(context, VideoPlayerService.class);
activity.bindService(videoPlayerIntent, mConnection, Context.BIND_AUTO_CREATE);
}
}
private void loadVideo() {
Context context = getContext();
// get video details from api
String apiBaseURL = APIUrlHelper.getUrlWithVersion(context);
2020-11-22 13:54:54 +01:00
GetVideoDataService service = RetrofitInstance.getRetrofitInstance(apiBaseURL, APIUrlHelper.useInsecureConnection(context)).create(GetVideoDataService.class);
2019-01-06 02:14:03 +01:00
Call<Video> call = service.getVideoData(mVideoUuid);
call.enqueue(new Callback<Video>() {
@Override
public void onResponse(@NonNull Call<Video> call, @NonNull Response<Video> response) {
Video video = response.body();
mService.setCurrentVideo(video);
if (video == null) {
Toast.makeText(context, "Unable to retrieve video information, try again later.", Toast.LENGTH_SHORT).show();
2019-01-06 02:14:03 +01:00
return;
}
playVideo(video);
}
@Override
public void onFailure(@NonNull Call<Video> call, @NonNull Throwable t) {
Log.wtf(TAG, t.fillInStackTrace());
ErrorHelper.showToastFromCommunicationError( getActivity(), t );
2019-01-06 02:14:03 +01:00
}
});
}
2020-07-05 15:07:50 +02:00
public void useController(boolean value) {
if (mBound) {
2020-06-28 16:49:36 +02:00
simpleExoPlayerView.setUseController(value);
}
2020-06-28 16:29:40 +02:00
}
2020-07-05 15:07:50 +02:00
2019-01-06 02:14:03 +01:00
private void playVideo(Video video) {
Context context = getContext();
// video Meta fragment
VideoMetaDataFragment videoMetaDataFragment = (VideoMetaDataFragment)
2020-07-05 15:07:50 +02:00
requireActivity().getSupportFragmentManager().findFragmentById(R.id.video_meta_data_fragment);
2019-01-06 02:14:03 +01:00
assert videoMetaDataFragment != null;
videoMetaDataFragment.updateVideoMeta(video, mService);
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(context);
2019-01-06 02:14:03 +01:00
2020-07-05 16:12:35 +02:00
if (sharedPref.getBoolean(getString(R.string.pref_torrent_player_key), false)) {
torrentStatus.setVisibility(View.VISIBLE);
2019-01-06 02:14:03 +01:00
String stream = video.getFiles().get(0).getTorrentUrl();
Log.v(TAG, "getTorrentUrl : " + video.getFiles().get(0).getTorrentUrl());
torrentStream = setupTorrentStream();
torrentStream.startStream(stream);
} else {
2019-01-09 17:53:26 +01:00
2020-07-05 16:12:35 +02:00
Integer videoQuality = sharedPref.getInt(getString(R.string.pref_quality_key), 0);
2019-01-09 17:53:26 +01:00
//get video qualities
/// #
if (video.getFiles().size() > 0) {
String urlToPlay = video.getFiles().get( 0 ).getFileUrl();
for ( File file : video.getFiles() ) {
// Set quality if it matches
if ( file.getResolution().getId().equals( videoQuality ) ) {
urlToPlay = file.getFileUrl();
}
2019-01-09 17:53:26 +01:00
}
mService.setCurrentStreamUrl( urlToPlay );
torrentStatus.setVisibility(View.GONE);
startPlayer();
} else {
stopVideo();
Toast.makeText(context, R.string.api_error, Toast.LENGTH_LONG).show();
2019-01-09 17:53:26 +01:00
}
2019-01-06 02:14:03 +01:00
}
Log.v(TAG, "end of load Video");
}
private void startPlayer() {
2020-07-05 15:07:50 +02:00
Util.startForegroundService(requireContext(), videoPlayerIntent);
2019-01-06 02:14:03 +01:00
}
public void destroyVideo() {
simpleExoPlayerView.setPlayer(null);
if (torrentStream != null) {
torrentStream.stopStream();
}
}
Master (#170) * Translations (#163) * Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 38.7% (125 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 48.0% (155 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (German) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Bengali) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Spanish) Currently translated at 42.1% (136 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Persian) Currently translated at 40.2% (130 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Russian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 Co-authored-by: Michael Moroni <michaelmoroni@disroot.org> Co-authored-by: mostkai <admin@pwplayer.com> Co-authored-by: B0pol <bopol@e.email> Co-authored-by: Jeannette L <j.lavoie@net-c.ca> Co-authored-by: Nathan <bonnemainsnathan@gmail.com> Co-authored-by: Mihail Iosilevitch <yosik@tutanota.com> Co-authored-by: anonymous <noreply@weblate.org> Co-authored-by: Oymate <dhruboadittya96@gmail.com> Co-authored-by: Juanro49 <juanrobertogarciasanchez@gmail.com> Co-authored-by: Mostafa Ahangarha <ahangarha@gmail.com> Co-authored-by: Szylu <chipolade@gmail.com> Co-authored-by: Artem <KovalevArtem.ru@gmail.com> Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller <sschueller@nunight.com> * Release 1.0.36 (#166) * Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 38.7% (125 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 48.0% (155 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (German) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Bengali) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Spanish) Currently translated at 42.1% (136 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Persian) Currently translated at 40.2% (130 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Russian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 * try to fix 'cannot make a new request because the previous response ... ' error (#164) * Translations (#163) * Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 38.7% (125 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 48.0% (155 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (German) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Bengali) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Spanish) Currently translated at 42.1% (136 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Persian) Currently translated at 40.2% (130 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Russian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 Co-authored-by: Michael Moroni <michaelmoroni@disroot.org> Co-authored-by: mostkai <admin@pwplayer.com> Co-authored-by: B0pol <bopol@e.email> Co-authored-by: Jeannette L <j.lavoie@net-c.ca> Co-authored-by: Nathan <bonnemainsnathan@gmail.com> Co-authored-by: Mihail Iosilevitch <yosik@tutanota.com> Co-authored-by: anonymous <noreply@weblate.org> Co-authored-by: Oymate <dhruboadittya96@gmail.com> Co-authored-by: Juanro49 <juanrobertogarciasanchez@gmail.com> Co-authored-by: Mostafa Ahangarha <ahangarha@gmail.com> Co-authored-by: Szylu <chipolade@gmail.com> Co-authored-by: Artem <KovalevArtem.ru@gmail.com> Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller <sschueller@nunight.com> * try to fix 'cannot make a new request because the previous response is still open' when login. Co-authored-by: Stefan Schüller <sschueller@techdroid.com> Co-authored-by: Michael Moroni <michaelmoroni@disroot.org> Co-authored-by: mostkai <admin@pwplayer.com> Co-authored-by: B0pol <bopol@e.email> Co-authored-by: Jeannette L <j.lavoie@net-c.ca> Co-authored-by: Nathan <bonnemainsnathan@gmail.com> Co-authored-by: Mihail Iosilevitch <yosik@tutanota.com> Co-authored-by: anonymous <noreply@weblate.org> Co-authored-by: Oymate <dhruboadittya96@gmail.com> Co-authored-by: Juanro49 <juanrobertogarciasanchez@gmail.com> Co-authored-by: Mostafa Ahangarha <ahangarha@gmail.com> Co-authored-by: Szylu <chipolade@gmail.com> Co-authored-by: Artem <KovalevArtem.ru@gmail.com> Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller <sschueller@nunight.com> * Release 1.0.36 Co-authored-by: Michael Moroni <michaelmoroni@disroot.org> Co-authored-by: mostkai <admin@pwplayer.com> Co-authored-by: B0pol <bopol@e.email> Co-authored-by: Jeannette L <j.lavoie@net-c.ca> Co-authored-by: Nathan <bonnemainsnathan@gmail.com> Co-authored-by: Mihail Iosilevitch <yosik@tutanota.com> Co-authored-by: anonymous <noreply@weblate.org> Co-authored-by: Oymate <dhruboadittya96@gmail.com> Co-authored-by: Juanro49 <juanrobertogarciasanchez@gmail.com> Co-authored-by: Mostafa Ahangarha <ahangarha@gmail.com> Co-authored-by: Szylu <chipolade@gmail.com> Co-authored-by: Artem <KovalevArtem.ru@gmail.com> Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller <sschueller@nunight.com> Co-authored-by: lishoujun <lsjun@aliyun.com> * Adding configuration setting and supporting code to pause playback on back button. (#167) Co-authored-by: Michael Moroni <michaelmoroni@disroot.org> Co-authored-by: mostkai <admin@pwplayer.com> Co-authored-by: B0pol <bopol@e.email> Co-authored-by: Jeannette L <j.lavoie@net-c.ca> Co-authored-by: Nathan <bonnemainsnathan@gmail.com> Co-authored-by: Mihail Iosilevitch <yosik@tutanota.com> Co-authored-by: anonymous <noreply@weblate.org> Co-authored-by: Oymate <dhruboadittya96@gmail.com> Co-authored-by: Juanro49 <juanrobertogarciasanchez@gmail.com> Co-authored-by: Mostafa Ahangarha <ahangarha@gmail.com> Co-authored-by: Szylu <chipolade@gmail.com> Co-authored-by: Artem <KovalevArtem.ru@gmail.com> Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller <sschueller@nunight.com> Co-authored-by: lishoujun <lsjun@aliyun.com> Co-authored-by: Don Kimberlin <donkimberlin@hotmail.com>
2020-06-19 08:31:42 +02:00
public void pauseVideo() {
2020-07-05 15:07:50 +02:00
if (mBound) {
mService.player.setPlayWhenReady(false);
}
}
2020-07-05 15:07:50 +02:00
public void pauseToggle() {
if (mBound) {
mService.player.setPlayWhenReady(!mService.player.getPlayWhenReady());
}
Master (#170) * Translations (#163) * Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 38.7% (125 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 48.0% (155 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (German) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Bengali) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Spanish) Currently translated at 42.1% (136 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Persian) Currently translated at 40.2% (130 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Russian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 Co-authored-by: Michael Moroni <michaelmoroni@disroot.org> Co-authored-by: mostkai <admin@pwplayer.com> Co-authored-by: B0pol <bopol@e.email> Co-authored-by: Jeannette L <j.lavoie@net-c.ca> Co-authored-by: Nathan <bonnemainsnathan@gmail.com> Co-authored-by: Mihail Iosilevitch <yosik@tutanota.com> Co-authored-by: anonymous <noreply@weblate.org> Co-authored-by: Oymate <dhruboadittya96@gmail.com> Co-authored-by: Juanro49 <juanrobertogarciasanchez@gmail.com> Co-authored-by: Mostafa Ahangarha <ahangarha@gmail.com> Co-authored-by: Szylu <chipolade@gmail.com> Co-authored-by: Artem <KovalevArtem.ru@gmail.com> Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller <sschueller@nunight.com> * Release 1.0.36 (#166) * Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 38.7% (125 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 48.0% (155 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (German) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Bengali) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Spanish) Currently translated at 42.1% (136 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Persian) Currently translated at 40.2% (130 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Russian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 * try to fix 'cannot make a new request because the previous response ... ' error (#164) * Translations (#163) * Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 38.7% (125 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 48.0% (155 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (German) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Bengali) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Spanish) Currently translated at 42.1% (136 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Persian) Currently translated at 40.2% (130 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Russian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 Co-authored-by: Michael Moroni <michaelmoroni@disroot.org> Co-authored-by: mostkai <admin@pwplayer.com> Co-authored-by: B0pol <bopol@e.email> Co-authored-by: Jeannette L <j.lavoie@net-c.ca> Co-authored-by: Nathan <bonnemainsnathan@gmail.com> Co-authored-by: Mihail Iosilevitch <yosik@tutanota.com> Co-authored-by: anonymous <noreply@weblate.org> Co-authored-by: Oymate <dhruboadittya96@gmail.com> Co-authored-by: Juanro49 <juanrobertogarciasanchez@gmail.com> Co-authored-by: Mostafa Ahangarha <ahangarha@gmail.com> Co-authored-by: Szylu <chipolade@gmail.com> Co-authored-by: Artem <KovalevArtem.ru@gmail.com> Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller <sschueller@nunight.com> * try to fix 'cannot make a new request because the previous response is still open' when login. Co-authored-by: Stefan Schüller <sschueller@techdroid.com> Co-authored-by: Michael Moroni <michaelmoroni@disroot.org> Co-authored-by: mostkai <admin@pwplayer.com> Co-authored-by: B0pol <bopol@e.email> Co-authored-by: Jeannette L <j.lavoie@net-c.ca> Co-authored-by: Nathan <bonnemainsnathan@gmail.com> Co-authored-by: Mihail Iosilevitch <yosik@tutanota.com> Co-authored-by: anonymous <noreply@weblate.org> Co-authored-by: Oymate <dhruboadittya96@gmail.com> Co-authored-by: Juanro49 <juanrobertogarciasanchez@gmail.com> Co-authored-by: Mostafa Ahangarha <ahangarha@gmail.com> Co-authored-by: Szylu <chipolade@gmail.com> Co-authored-by: Artem <KovalevArtem.ru@gmail.com> Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller <sschueller@nunight.com> * Release 1.0.36 Co-authored-by: Michael Moroni <michaelmoroni@disroot.org> Co-authored-by: mostkai <admin@pwplayer.com> Co-authored-by: B0pol <bopol@e.email> Co-authored-by: Jeannette L <j.lavoie@net-c.ca> Co-authored-by: Nathan <bonnemainsnathan@gmail.com> Co-authored-by: Mihail Iosilevitch <yosik@tutanota.com> Co-authored-by: anonymous <noreply@weblate.org> Co-authored-by: Oymate <dhruboadittya96@gmail.com> Co-authored-by: Juanro49 <juanrobertogarciasanchez@gmail.com> Co-authored-by: Mostafa Ahangarha <ahangarha@gmail.com> Co-authored-by: Szylu <chipolade@gmail.com> Co-authored-by: Artem <KovalevArtem.ru@gmail.com> Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller <sschueller@nunight.com> Co-authored-by: lishoujun <lsjun@aliyun.com> * Adding configuration setting and supporting code to pause playback on back button. (#167) Co-authored-by: Michael Moroni <michaelmoroni@disroot.org> Co-authored-by: mostkai <admin@pwplayer.com> Co-authored-by: B0pol <bopol@e.email> Co-authored-by: Jeannette L <j.lavoie@net-c.ca> Co-authored-by: Nathan <bonnemainsnathan@gmail.com> Co-authored-by: Mihail Iosilevitch <yosik@tutanota.com> Co-authored-by: anonymous <noreply@weblate.org> Co-authored-by: Oymate <dhruboadittya96@gmail.com> Co-authored-by: Juanro49 <juanrobertogarciasanchez@gmail.com> Co-authored-by: Mostafa Ahangarha <ahangarha@gmail.com> Co-authored-by: Szylu <chipolade@gmail.com> Co-authored-by: Artem <KovalevArtem.ru@gmail.com> Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller <sschueller@nunight.com> Co-authored-by: lishoujun <lsjun@aliyun.com> Co-authored-by: Don Kimberlin <donkimberlin@hotmail.com>
2020-06-19 08:31:42 +02:00
}
2020-07-05 15:07:50 +02:00
public void unPauseVideo() {
if (mBound) {
mService.player.setPlayWhenReady(true);
}
Master (#170) * Translations (#163) * Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 38.7% (125 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 48.0% (155 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (German) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Bengali) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Spanish) Currently translated at 42.1% (136 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Persian) Currently translated at 40.2% (130 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Russian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 Co-authored-by: Michael Moroni <michaelmoroni@disroot.org> Co-authored-by: mostkai <admin@pwplayer.com> Co-authored-by: B0pol <bopol@e.email> Co-authored-by: Jeannette L <j.lavoie@net-c.ca> Co-authored-by: Nathan <bonnemainsnathan@gmail.com> Co-authored-by: Mihail Iosilevitch <yosik@tutanota.com> Co-authored-by: anonymous <noreply@weblate.org> Co-authored-by: Oymate <dhruboadittya96@gmail.com> Co-authored-by: Juanro49 <juanrobertogarciasanchez@gmail.com> Co-authored-by: Mostafa Ahangarha <ahangarha@gmail.com> Co-authored-by: Szylu <chipolade@gmail.com> Co-authored-by: Artem <KovalevArtem.ru@gmail.com> Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller <sschueller@nunight.com> * Release 1.0.36 (#166) * Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 38.7% (125 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 48.0% (155 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (German) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Bengali) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Spanish) Currently translated at 42.1% (136 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Persian) Currently translated at 40.2% (130 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Russian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 * try to fix 'cannot make a new request because the previous response ... ' error (#164) * Translations (#163) * Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 38.7% (125 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 48.0% (155 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (German) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Bengali) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Spanish) Currently translated at 42.1% (136 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Persian) Currently translated at 40.2% (130 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Russian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 Co-authored-by: Michael Moroni <michaelmoroni@disroot.org> Co-authored-by: mostkai <admin@pwplayer.com> Co-authored-by: B0pol <bopol@e.email> Co-authored-by: Jeannette L <j.lavoie@net-c.ca> Co-authored-by: Nathan <bonnemainsnathan@gmail.com> Co-authored-by: Mihail Iosilevitch <yosik@tutanota.com> Co-authored-by: anonymous <noreply@weblate.org> Co-authored-by: Oymate <dhruboadittya96@gmail.com> Co-authored-by: Juanro49 <juanrobertogarciasanchez@gmail.com> Co-authored-by: Mostafa Ahangarha <ahangarha@gmail.com> Co-authored-by: Szylu <chipolade@gmail.com> Co-authored-by: Artem <KovalevArtem.ru@gmail.com> Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller <sschueller@nunight.com> * try to fix 'cannot make a new request because the previous response is still open' when login. Co-authored-by: Stefan Schüller <sschueller@techdroid.com> Co-authored-by: Michael Moroni <michaelmoroni@disroot.org> Co-authored-by: mostkai <admin@pwplayer.com> Co-authored-by: B0pol <bopol@e.email> Co-authored-by: Jeannette L <j.lavoie@net-c.ca> Co-authored-by: Nathan <bonnemainsnathan@gmail.com> Co-authored-by: Mihail Iosilevitch <yosik@tutanota.com> Co-authored-by: anonymous <noreply@weblate.org> Co-authored-by: Oymate <dhruboadittya96@gmail.com> Co-authored-by: Juanro49 <juanrobertogarciasanchez@gmail.com> Co-authored-by: Mostafa Ahangarha <ahangarha@gmail.com> Co-authored-by: Szylu <chipolade@gmail.com> Co-authored-by: Artem <KovalevArtem.ru@gmail.com> Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller <sschueller@nunight.com> * Release 1.0.36 Co-authored-by: Michael Moroni <michaelmoroni@disroot.org> Co-authored-by: mostkai <admin@pwplayer.com> Co-authored-by: B0pol <bopol@e.email> Co-authored-by: Jeannette L <j.lavoie@net-c.ca> Co-authored-by: Nathan <bonnemainsnathan@gmail.com> Co-authored-by: Mihail Iosilevitch <yosik@tutanota.com> Co-authored-by: anonymous <noreply@weblate.org> Co-authored-by: Oymate <dhruboadittya96@gmail.com> Co-authored-by: Juanro49 <juanrobertogarciasanchez@gmail.com> Co-authored-by: Mostafa Ahangarha <ahangarha@gmail.com> Co-authored-by: Szylu <chipolade@gmail.com> Co-authored-by: Artem <KovalevArtem.ru@gmail.com> Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller <sschueller@nunight.com> Co-authored-by: lishoujun <lsjun@aliyun.com> * Adding configuration setting and supporting code to pause playback on back button. (#167) Co-authored-by: Michael Moroni <michaelmoroni@disroot.org> Co-authored-by: mostkai <admin@pwplayer.com> Co-authored-by: B0pol <bopol@e.email> Co-authored-by: Jeannette L <j.lavoie@net-c.ca> Co-authored-by: Nathan <bonnemainsnathan@gmail.com> Co-authored-by: Mihail Iosilevitch <yosik@tutanota.com> Co-authored-by: anonymous <noreply@weblate.org> Co-authored-by: Oymate <dhruboadittya96@gmail.com> Co-authored-by: Juanro49 <juanrobertogarciasanchez@gmail.com> Co-authored-by: Mostafa Ahangarha <ahangarha@gmail.com> Co-authored-by: Szylu <chipolade@gmail.com> Co-authored-by: Artem <KovalevArtem.ru@gmail.com> Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller <sschueller@nunight.com> Co-authored-by: lishoujun <lsjun@aliyun.com> Co-authored-by: Don Kimberlin <donkimberlin@hotmail.com>
2020-06-19 08:31:42 +02:00
}
2020-07-05 15:07:50 +02:00
public float getVideoAspectRatio() { return aspectRatio; }
2020-07-05 15:07:50 +02:00
public boolean isPaused() {
return !mService.player.getPlayWhenReady();
}
2020-07-05 15:07:50 +02:00
public void showControls(boolean value) {
2020-07-01 18:04:20 +02:00
simpleExoPlayerView.setUseController(value);
}
2020-07-05 15:07:50 +02:00
2019-01-06 02:14:03 +01:00
public void stopVideo() {
if (mBound) {
2020-07-05 15:07:50 +02:00
requireContext().unbindService(mConnection);
2019-01-06 02:14:03 +01:00
mBound = false;
}
}
public void setIsFullscreen(Boolean fullscreen) {
isFullscreen = fullscreen;
2020-07-05 15:07:50 +02:00
TextView fullscreenButton = requireActivity().findViewById(R.id.exo_fullscreen);
if (fullscreen) {
fullscreenButton.setText(R.string.video_compress_icon);
} else {
fullscreenButton.setText(R.string.video_expand_icon);
}
new Iconics.IconicsBuilder().ctx(getContext()).on(fullscreenButton).build();
}
public Boolean getIsFullscreen() {
return isFullscreen;
}
2020-07-05 15:07:50 +02:00
public void fullScreenToggle() {
if (!isFullscreen) {
setIsFullscreen(true);
2020-07-05 15:07:50 +02:00
requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
} else {
setIsFullscreen(false);
2020-07-05 15:07:50 +02:00
requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
}
2020-07-05 15:07:50 +02:00
2019-01-06 02:14:03 +01:00
/**
* Torrent Playback
*
* @return torrent stream
*/
private TorrentStream setupTorrentStream() {
TorrentOptions torrentOptions = new TorrentOptions.Builder()
.saveLocation(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS))
.removeFilesAfterStop(true)
.build();
TorrentStream torrentStream = TorrentStream.init(torrentOptions);
torrentStream.addListener(new TorrentListener() {
@Override
public void onStreamReady(Torrent torrent) {
String videopath = Uri.fromFile(torrent.getVideoFile()).toString();
Log.d(TAG, "Ready! torrentStream videopath:" + videopath);
mService.setCurrentStreamUrl(videopath);
startPlayer();
}
@Override
public void onStreamProgress(Torrent torrent, StreamStatus streamStatus) {
if (streamStatus.bufferProgress <= 100 && progressBar.getProgress() < 100 && progressBar.getProgress() != streamStatus.bufferProgress) {
//Log.d(TAG, "Progress: " + streamStatus.bufferProgress);
progressBar.setProgress(streamStatus.bufferProgress);
}
}
@Override
public void onStreamStopped() {
Log.d(TAG, "Stopped");
}
@Override
public void onStreamPrepared(Torrent torrent) {
Log.d(TAG, "Prepared");
}
@Override
public void onStreamStarted(Torrent torrent) {
Log.d(TAG, "Started");
}
@Override
public void onStreamError(Torrent torrent, Exception e) {
Log.d(TAG, "Error: " + e.getMessage());
}
});
return torrentStream;
}
@Override
public void onVideoEnabled(DecoderCounters counters) {
Log.v(TAG, "onVideoEnabled()...");
}
@Override
public void onVideoDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs) {
}
@Override
public void onVideoInputFormatChanged(Format format) {
}
@Override
public void onDroppedFrames(int count, long elapsedMs) {
}
@Override
public void onVideoSizeChanged(int width, int height, int unappliedRotationDegrees, float pixelWidthHeightRatio) {
}
@Override
public void onRenderedFirstFrame(Surface surface) {
}
@Override
public void onVideoDisabled(DecoderCounters counters) {
Log.v(TAG, "onVideoDisabled()...");
}
View.OnTouchListener touchListener = new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
return mDetector.onTouchEvent(event);
}
};
2020-07-05 15:07:50 +02:00
public String getVideoUuid() {
return mVideoUuid;
}
2020-07-05 15:07:50 +02:00
class MyGestureListener extends GestureDetector.SimpleOnGestureListener {
2020-07-05 15:07:50 +02:00
/*
@Override
public boolean onDown(MotionEvent event) {
Log.d("TAG","onDown: ");
return true;
}
2020-07-05 15:07:50 +02:00
@Override
public boolean onSingleTapConfirmed(MotionEvent e) {
Log.i("TAG", "onSingleTapConfirmed: ");
pauseToggle();
return true;
}
2020-07-05 15:07:50 +02:00
@Override
public void onLongPress(MotionEvent e) {
Log.i("TAG", "onLongPress: ");
}
2020-07-05 15:07:50 +02:00
@Override
public boolean onDoubleTap(MotionEvent e) {
Log.i("TAG", "onDoubleTap: ");
return true;
}
2020-07-05 15:07:50 +02:00
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2,
float distanceX, float distanceY) {
Log.i("TAG", "onScroll: ");
return true;
}
*/
@RequiresApi(api = Build.VERSION_CODES.N)
@Override
public boolean onFling(MotionEvent event1, MotionEvent event2,
float velocityX, float velocityY) {
2020-07-05 15:07:50 +02:00
Log.d(TAG, event1.toString());
Log.d(TAG, event2.toString());
Log.d(TAG, String.valueOf(velocityX));
2020-07-05 15:07:50 +02:00
Log.d(TAG, String.valueOf(velocityY));
//arbitrarily velocity speeds that seem to work to differentiate events.
2020-07-05 15:07:50 +02:00
if (velocityY > 4000) {
Log.d(TAG, "we have a drag down event");
if (canEnterPipMode(getContext())) {
2020-07-05 15:07:50 +02:00
requireActivity().enterPictureInPictureMode();
}
}
2020-07-05 15:07:50 +02:00
if ((velocityX > 2000) && (Math.abs(velocityY) < 2000)) {
Log.d(TAG, "swipe right " + velocityY);
}
2020-07-05 15:07:50 +02:00
if ((velocityX < 2000) && (Math.abs(velocityY) < 2000)) {
Log.d(TAG, "swipe left " + velocityY);
}
return true;
}
}
2019-01-06 02:14:03 +01:00
}