From fcfe47a14bc072c65b3b18ccbd4ebf679f0a09ec Mon Sep 17 00:00:00 2001 From: Stefan Schueller Date: Sun, 11 Mar 2018 02:25:19 +0100 Subject: [PATCH] cleanup --- .../peertube/activity/TorrentVideoPlayActivity.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/net/schueller/peertube/activity/TorrentVideoPlayActivity.java b/app/src/main/java/net/schueller/peertube/activity/TorrentVideoPlayActivity.java index 15cbb39..61d8115 100644 --- a/app/src/main/java/net/schueller/peertube/activity/TorrentVideoPlayActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/TorrentVideoPlayActivity.java @@ -111,15 +111,6 @@ public class TorrentVideoPlayActivity extends AppCompatActivity { @Override public void onStreamPrepared(Torrent torrent) { Log.d(TAG, "Prepared"); - - if(!torrentStream.isStreaming()) { - torrent.startDownload(); - } - - - - // If you set TorrentOptions#autoDownload(false) then this is probably the place to call - // torrent.startDownload(); } @Override @@ -185,11 +176,13 @@ public class TorrentVideoPlayActivity extends AppCompatActivity { // Produces DataSource instances through which media data is loaded. DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(getApplicationContext(), - Util.getUserAgent(getApplicationContext(), "yourApplicationName"), null); + Util.getUserAgent(getApplicationContext(), "PeerTube"), null); + // This is the MediaSource representing the media to be played. MediaSource videoSource = new ExtractorMediaSource.Factory(dataSourceFactory) .createMediaSource(Uri.fromFile(torrent.getVideoFile())); + // Auto play player.setPlayWhenReady(true); // Prepare the player with the source.