Commit 3fa65f45 authored by Geoffrey Métais's avatar Geoffrey Métais

TV: Play the whole playlist from playlist view

parent 961e9042
......@@ -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)
}
......
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment