[Android] Video player: Correctly apply extra title

Geoffrey Métais git at videolan.org
Wed Jan 22 17:09:45 CET 2020


vlc-android | branch: 3.2.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Jan 20 16:00:27 2020 +0000| [0351475a5def062ee811ec485f1061482f302bbe] | committer: Geoffrey Métais

Video player: Correctly apply extra title

Fix #1156


(cherry picked from commit 84d7febc0438f9c7258e61132932fb5e2f5f5b2a)

> https://code.videolan.org/videolan/vlc-android/commit/0351475a5def062ee811ec485f1061482f302bbe
---

 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
index 98c0bb5e5..398437df6 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -2427,6 +2427,7 @@ open class VideoPlayerActivity : AppCompatActivity(), IPlaybackSettingsControlle
                 /* prepare playback */
                 val medialoaded = media != null
                 if (!medialoaded) media = if (hasMedia) currentMedia else MLServiceLocator.getAbstractMediaWrapper(videoUri!!)
+                itemTitle?.let { media?.title = Uri.decode(it) }
                 if (wasPaused)
                     media!!.addFlags(AbstractMediaWrapper.MEDIA_PAUSED)
                 if (intent.hasExtra(PLAY_DISABLE_HARDWARE))
@@ -2448,10 +2449,7 @@ open class VideoPlayerActivity : AppCompatActivity(), IPlaybackSettingsControlle
                         onPlaying()
                     } else
                         service.playIndex(positionInPlaylist)
-                } else if (medialoaded)
-                    service.load(media)
-                else
-                    service.loadUri(videoUri)
+                } else service.load(media)
 
                 // Get the title
                 if (itemTitle == null && !TextUtils.equals(videoUri!!.scheme, "content"))



More information about the Android mailing list