Merge pull request #46 from sschueller/develop

Release v1.0.8
This commit is contained in:
Stefan Schüller 2018-12-17 21:33:13 +01:00 committed by GitHub
commit 050f16094e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 5 deletions

View File

@ -6,8 +6,8 @@ android {
applicationId "net.schueller.peertube"
minSdkVersion 21
targetSdkVersion 28
versionCode 107
versionName "1.0.7"
versionCode 109
versionName "1.0.9"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

View File

@ -9,6 +9,9 @@
<!-- required for torrent downloading -->
<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
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"

View File

@ -206,14 +206,14 @@ public class VideoPlayActivity extends AppCompatActivity implements VideoRendere
{
// get video ID
Intent intent = getIntent();
String videoID = intent.getStringExtra(VideoListActivity.EXTRA_VIDEOID);
Log.v(TAG, "click: " + videoID);
String videoUuid = intent.getStringExtra(VideoListActivity.EXTRA_VIDEOID);
Log.v(TAG, "click: " + videoUuid);
// get video details from api
String apiBaseURL = APIUrlHelper.getUrlWithVersion(this);
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>() {
@Override

View File

@ -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_PLAY;
import static net.schueller.peertube.activity.VideoListActivity.EXTRA_VIDEOID;
public class VideoPlayerService extends Service {
@ -156,6 +157,7 @@ public class VideoPlayerService extends Service {
@Override
public PendingIntent createCurrentContentIntent(Player player) {
Intent intent = new Intent(context, VideoPlayActivity.class);
intent.putExtra(EXTRA_VIDEOID, currentVideo.getUuid());
return PendingIntent.getActivity(context, 0, intent,
PendingIntent.FLAG_UPDATE_CURRENT);
}
@ -179,6 +181,9 @@ public class VideoPlayerService extends Service {
playerNotificationManager.setSmallIcon(R.drawable.ic_peertube_bw);
// don't show skip buttons in notification
playerNotificationManager.setUseNavigationActions(false);
playerNotificationManager.setNotificationListener(
new PlayerNotificationManager.NotificationListener() {
@Override