[Android] Video player: Correctly apply extra title

Geoffrey Métais git at videolan.org
Tue Jan 21 08:44:47 CET 2020


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Jan 20 17:00:27 2020 +0100| [84d7febc0438f9c7258e61132932fb5e2f5f5b2a] | committer: Nicolas Pomepuy

Video player: Correctly apply extra title

Fix #1156

> https://code.videolan.org/videolan/vlc-android/commit/84d7febc0438f9c7258e61132932fb5e2f5f5b2a
---

 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 16123b5c0..6a02764ef 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -2513,6 +2513,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(MediaWrapper.MEDIA_PAUSED)
                 if (intent.hasExtra(PLAY_DISABLE_HARDWARE))
@@ -2534,10 +2535,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