commit
050f16094e
|
@ -6,8 +6,8 @@ android {
|
||||||
applicationId "net.schueller.peertube"
|
applicationId "net.schueller.peertube"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode 107
|
versionCode 109
|
||||||
versionName "1.0.7"
|
versionName "1.0.9"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
|
|
@ -9,6 +9,9 @@
|
||||||
<!-- required for torrent downloading -->
|
<!-- required for torrent downloading -->
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
|
||||||
|
<!-- required to play video in background via notification -->
|
||||||
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
|
|
|
@ -206,14 +206,14 @@ public class VideoPlayActivity extends AppCompatActivity implements VideoRendere
|
||||||
{
|
{
|
||||||
// get video ID
|
// get video ID
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
String videoID = intent.getStringExtra(VideoListActivity.EXTRA_VIDEOID);
|
String videoUuid = intent.getStringExtra(VideoListActivity.EXTRA_VIDEOID);
|
||||||
Log.v(TAG, "click: " + videoID);
|
Log.v(TAG, "click: " + videoUuid);
|
||||||
|
|
||||||
// get video details from api
|
// get video details from api
|
||||||
String apiBaseURL = APIUrlHelper.getUrlWithVersion(this);
|
String apiBaseURL = APIUrlHelper.getUrlWithVersion(this);
|
||||||
GetVideoDataService service = RetrofitInstance.getRetrofitInstance(apiBaseURL).create(GetVideoDataService.class);
|
GetVideoDataService service = RetrofitInstance.getRetrofitInstance(apiBaseURL).create(GetVideoDataService.class);
|
||||||
|
|
||||||
Call<Video> call = service.getVideoData(videoID);
|
Call<Video> call = service.getVideoData(videoUuid);
|
||||||
|
|
||||||
call.enqueue(new Callback<Video>() {
|
call.enqueue(new Callback<Video>() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -32,6 +32,7 @@ import net.schueller.peertube.model.Video;
|
||||||
|
|
||||||
import static android.media.session.PlaybackState.ACTION_PAUSE;
|
import static android.media.session.PlaybackState.ACTION_PAUSE;
|
||||||
import static android.media.session.PlaybackState.ACTION_PLAY;
|
import static android.media.session.PlaybackState.ACTION_PLAY;
|
||||||
|
import static net.schueller.peertube.activity.VideoListActivity.EXTRA_VIDEOID;
|
||||||
|
|
||||||
public class VideoPlayerService extends Service {
|
public class VideoPlayerService extends Service {
|
||||||
|
|
||||||
|
@ -156,6 +157,7 @@ public class VideoPlayerService extends Service {
|
||||||
@Override
|
@Override
|
||||||
public PendingIntent createCurrentContentIntent(Player player) {
|
public PendingIntent createCurrentContentIntent(Player player) {
|
||||||
Intent intent = new Intent(context, VideoPlayActivity.class);
|
Intent intent = new Intent(context, VideoPlayActivity.class);
|
||||||
|
intent.putExtra(EXTRA_VIDEOID, currentVideo.getUuid());
|
||||||
return PendingIntent.getActivity(context, 0, intent,
|
return PendingIntent.getActivity(context, 0, intent,
|
||||||
PendingIntent.FLAG_UPDATE_CURRENT);
|
PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
}
|
}
|
||||||
|
@ -179,6 +181,9 @@ public class VideoPlayerService extends Service {
|
||||||
|
|
||||||
playerNotificationManager.setSmallIcon(R.drawable.ic_peertube_bw);
|
playerNotificationManager.setSmallIcon(R.drawable.ic_peertube_bw);
|
||||||
|
|
||||||
|
// don't show skip buttons in notification
|
||||||
|
playerNotificationManager.setUseNavigationActions(false);
|
||||||
|
|
||||||
playerNotificationManager.setNotificationListener(
|
playerNotificationManager.setNotificationListener(
|
||||||
new PlayerNotificationManager.NotificationListener() {
|
new PlayerNotificationManager.NotificationListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue