[Android] TV: Play the whole playlist from playlist view
Geoffrey Métais
git at videolan.org
Wed Jul 17 10:51:28 CEST 2019
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jul 17 10:49:05 2019 +0200| [3fa65f45a93566ccc0927bfa73304be476149d80] | committer: Geoffrey Métais
TV: Play the whole playlist from playlist view
> https://code.videolan.org/videolan/vlc-android/commit/3fa65f45a93566ccc0927bfa73304be476149d80
---
vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.kt | 3 ++-
vlc-android/src/org/videolan/vlc/gui/tv/details/MediaListActivity.kt | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.kt b/vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.kt
index cae2e397c..3a54331e8 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.kt
@@ -118,9 +118,10 @@ object TvUtil {
MediaUtils.openMedia(activity, media)
}
- fun playMedia(activity: Activity, media: List<AbstractMediaWrapper>) {
+ fun playMedia(activity: Activity, media: List<AbstractMediaWrapper>, position: Int = 0) {
val intent = Intent(activity, AudioPlayerActivity::class.java)
intent.putExtra(AudioPlayerActivity.MEDIA_LIST, ArrayList(media))
+ intent.putExtra(AudioPlayerActivity.MEDIA_POSITION, position)
activity.startActivity(intent)
}
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/details/MediaListActivity.kt b/vlc-android/src/org/videolan/vlc/gui/tv/details/MediaListActivity.kt
index 60eb59870..804332f96 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/details/MediaListActivity.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/details/MediaListActivity.kt
@@ -133,7 +133,7 @@ class MediaListActivity : BaseTvActivity(), ITVEventsHandler, CoroutineScope by
}
override fun onClickPlay(v: View, position: Int) {
- TvUtil.playMedia(this, item.tracks[position])
+ TvUtil.playMedia(this, item.tracks.toList(), position)
}
override fun onClickPlayNext(v: View, position: Int) {
More information about the Android
mailing list