mirror of
https://framagit.org/tom79/fedilab-tube
synced 2025-06-05 21:09:11 +02:00
some fixes
This commit is contained in:
@ -24,7 +24,6 @@ import static app.fedilab.fedilabtube.helper.Helper.canMakeAction;
|
||||
import static app.fedilab.fedilabtube.helper.Helper.getAttColor;
|
||||
import static app.fedilab.fedilabtube.helper.Helper.isLoggedIn;
|
||||
import static app.fedilab.fedilabtube.helper.Helper.loadAvatar;
|
||||
import static app.fedilab.fedilabtube.helper.Helper.loadGiF;
|
||||
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
|
||||
|
||||
import android.Manifest;
|
||||
@ -56,6 +55,7 @@ import android.text.TextPaint;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.text.style.ClickableSpan;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.MotionEvent;
|
||||
@ -160,7 +160,6 @@ import app.fedilab.fedilabtube.drawer.MenuAdapter;
|
||||
import app.fedilab.fedilabtube.drawer.MenuItemAdapter;
|
||||
import app.fedilab.fedilabtube.helper.CacheDataSourceFactory;
|
||||
import app.fedilab.fedilabtube.helper.Helper;
|
||||
import app.fedilab.fedilabtube.helper.HelperAcadInstance;
|
||||
import app.fedilab.fedilabtube.helper.HelperInstance;
|
||||
import app.fedilab.fedilabtube.helper.Theme;
|
||||
import app.fedilab.fedilabtube.sqlite.AccountDAO;
|
||||
@ -234,22 +233,25 @@ public class PeertubeActivity extends BasePeertubeActivity implements CommentLis
|
||||
|
||||
@Override
|
||||
public void onStreamPrepared(Torrent torrent) {
|
||||
Log.v(Helper.TAG,"onStreamPrepared: " + torrent);
|
||||
torrent.startDownload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStreamStarted(Torrent torrent) {
|
||||
|
||||
Log.v(Helper.TAG,"onStreamStarted: " + torrent);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStreamError(Torrent torrent, Exception e) {
|
||||
Log.v(Helper.TAG,"onStreamError: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStreamReady(Torrent torrent) {
|
||||
Log.v(Helper.TAG,"onStreamReady: " + torrent);
|
||||
if (torrent.getVideoFile() != null) {
|
||||
for (int i = 0; i < torrent.getFileNames().length; i++) {
|
||||
torrent.getTorrentHandle().renameFile(i, torrent.getFileNames()[0].replaceAll("[^a-zA-Z0-9/.-]", "_"));
|
||||
@ -284,6 +286,7 @@ public class PeertubeActivity extends BasePeertubeActivity implements CommentLis
|
||||
|
||||
@Override
|
||||
public void onStreamProgress(Torrent torrent, StreamStatus status) {
|
||||
Log.v(Helper.TAG,"onStreamProgress: " + torrent);
|
||||
if (binding != null) {
|
||||
PlayerControlView controlView = binding.doubleTapPlayerView.findViewById(R.id.exo_controller);
|
||||
TextView peers_number = controlView.findViewById(R.id.peers_number);
|
||||
@ -293,6 +296,7 @@ public class PeertubeActivity extends BasePeertubeActivity implements CommentLis
|
||||
|
||||
@Override
|
||||
public void onStreamStopped() {
|
||||
Log.v(Helper.TAG,"onStreamStopped: ");
|
||||
}
|
||||
|
||||
|
||||
@ -1278,6 +1282,7 @@ public class PeertubeActivity extends BasePeertubeActivity implements CommentLis
|
||||
*/
|
||||
private void stream(VideoData.Video video, String localTorrentUrl, String resolution, boolean autoPlay, long position, Uri subtitles, String lang) {
|
||||
videoURL = localTorrentUrl == null ? video.getFileUrl(resolution, PeertubeActivity.this) : localTorrentUrl;
|
||||
Log.v(Helper.TAG,">>>>>>>>videoURL: " + videoURL );
|
||||
if (subtitles != null) {
|
||||
subtitlesStr = subtitles.toString();
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@ -248,6 +249,7 @@ public class VideoData {
|
||||
}
|
||||
}
|
||||
File file = Helper.defaultFile(context, files);
|
||||
|
||||
if (file != null) {
|
||||
if (mode == Helper.VIDEO_MODE_MAGNET) {
|
||||
if (file.getMagnetUri() != null) {
|
||||
|
Reference in New Issue
Block a user