Exoplayer
This commit is contained in:
parent
cdcc41ffac
commit
13a818b12d
|
@ -84,7 +84,6 @@ dependencies {
|
||||||
implementation 'com.github.GrenderG:Toasty:1.3.1'
|
implementation 'com.github.GrenderG:Toasty:1.3.1'
|
||||||
implementation 'com.elconfidencial.bubbleshowcase:bubbleshowcase:1.3.1'
|
implementation 'com.elconfidencial.bubbleshowcase:bubbleshowcase:1.3.1'
|
||||||
implementation 'com.android.support:multidex:1.0.3'
|
implementation 'com.android.support:multidex:1.0.3'
|
||||||
implementation 'com.google.android.exoplayer:exoplayer:2.9.3'
|
|
||||||
implementation "com.github.TorrentStream:TorrentStream-Android:$torrentstreamVersion"
|
implementation "com.github.TorrentStream:TorrentStream-Android:$torrentstreamVersion"
|
||||||
playstoreImplementation "io.github.kobakei:ratethisapp:$ratethisappLibraryVersion"
|
playstoreImplementation "io.github.kobakei:ratethisapp:$ratethisappLibraryVersion"
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ import android.content.res.Configuration;
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.media.AudioManager;
|
||||||
import android.media.MediaPlayer;
|
import android.media.MediaPlayer;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
|
@ -414,7 +415,7 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
|
||||||
@Override
|
@Override
|
||||||
public void onStreamReady(Torrent torrent) {
|
public void onStreamReady(Torrent torrent) {
|
||||||
Log.v(Helper.TAG,"onStreamReady");
|
Log.v(Helper.TAG,"onStreamReady");
|
||||||
videoView.setVideoURI(Uri.fromFile(torrent.getVideoFile()));
|
videoView.setVideoPath(torrent.getVideoFile().getAbsolutePath());
|
||||||
videoView.getCurrentPosition();
|
videoView.getCurrentPosition();
|
||||||
fullScreenMediaController = new FullScreenMediaController(PeertubeActivity.this, peertube);
|
fullScreenMediaController = new FullScreenMediaController(PeertubeActivity.this, peertube);
|
||||||
fullScreenMediaController.setPadding(0, 0, 0, (int) Helper.convertDpToPixel(25, PeertubeActivity.this));
|
fullScreenMediaController.setPadding(0, 0, 0, (int) Helper.convertDpToPixel(25, PeertubeActivity.this));
|
||||||
|
@ -425,6 +426,8 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
|
||||||
public void onPrepared(MediaPlayer mp) {
|
public void onPrepared(MediaPlayer mp) {
|
||||||
loader.setVisibility(View.GONE);
|
loader.setVisibility(View.GONE);
|
||||||
mediaPlayer = mp;
|
mediaPlayer = mp;
|
||||||
|
|
||||||
|
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
|
||||||
mp.start();
|
mp.start();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -433,6 +436,10 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStreamProgress(Torrent torrent, StreamStatus status) {
|
public void onStreamProgress(Torrent torrent, StreamStatus status) {
|
||||||
|
Log.v(Helper.TAG,"seeds: " + status.seeds);
|
||||||
|
Log.v(Helper.TAG,"progress: " + status.progress);
|
||||||
|
Log.v(Helper.TAG,"bufferProgress: " + status.bufferProgress);
|
||||||
|
Log.v(Helper.TAG,"downloadSpeed: " + status.downloadSpeed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -563,6 +570,13 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStop() {
|
||||||
|
super.onStop();
|
||||||
|
if( torrentStream != null && torrentStream.isStreaming())
|
||||||
|
torrentStream.stopStream();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
|
@ -634,7 +648,7 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
|
||||||
videoView.setVisibility(View.GONE);
|
videoView.setVisibility(View.GONE);
|
||||||
videoView.setVisibility(View.VISIBLE);
|
videoView.setVisibility(View.VISIBLE);
|
||||||
loader.setVisibility(View.GONE);
|
loader.setVisibility(View.GONE);
|
||||||
videoView.setVideoURI( Uri.fromFile(torrent.getVideoFile()));
|
videoView.setVideoPath(torrent.getVideoFile().getAbsolutePath());
|
||||||
fullScreenMediaController.setResolutionVal(res);
|
fullScreenMediaController.setResolutionVal(res);
|
||||||
videoView.seekTo(position);
|
videoView.seekTo(position);
|
||||||
videoView.start();
|
videoView.start();
|
||||||
|
|
Loading…
Reference in New Issue