[Android] Pass the title as well when switiching vout
Edward Wang
git at videolan.org
Tue Aug 28 17:16:01 CEST 2012
vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Thu Aug 23 11:05:31 2012 -0400| [7cdeb6481429fb65c6d34c3da6d9e0bdf587fd3c] | committer: Jean-Baptiste Kempf
Pass the title as well when switiching vout
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=7cdeb6481429fb65c6d34c3da6d9e0bdf587fd3c
---
vlc-android/src/org/videolan/vlc/AudioService.java | 2 +-
.../org/videolan/vlc/gui/video/VideoPlayerActivity.java | 13 +++++++++----
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/AudioService.java b/vlc-android/src/org/videolan/vlc/AudioService.java
index d2777f0..c0e2fb3 100644
--- a/vlc-android/src/org/videolan/vlc/AudioService.java
+++ b/vlc-android/src/org/videolan/vlc/AudioService.java
@@ -313,7 +313,7 @@ public class AudioService extends Service {
if(mCurrentMedia == null) return;
// Switch to the video player & don't lose the currently playing stream
- VideoPlayerActivity.start(VLCApplication.getAppContext(), mCurrentMedia.getLocation(), true);
+ VideoPlayerActivity.start(VLCApplication.getAppContext(), mCurrentMedia.getLocation(), mCurrentMedia.getTitle(), true);
}
private void executeUpdate() {
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 3263b9f..3a494d1 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -357,12 +357,13 @@ public class VideoPlayerActivity extends Activity {
}
public static void start(Context context, String location) {
- start(context, location, false);
+ start(context, location, null, false);
}
- public static void start(Context context, String location, Boolean dontParse) {
+ public static void start(Context context, String location, String title, Boolean dontParse) {
Intent intent = new Intent(context, VideoPlayerActivity.class);
intent.putExtra("itemLocation", location);
+ intent.putExtra("itemTitle", title);
intent.putExtra("dontParse", dontParse);
if (dontParse)
@@ -1124,8 +1125,9 @@ public class VideoPlayerActivity extends Activity {
*/
private void load() {
mLocation = null;
- String title = null;
+ String title = getResources().getString(R.string.title);
boolean dontParse = false;
+ String itemTitle = null;
if (getIntent().getAction() != null
&& getIntent().getAction().equals(Intent.ACTION_VIEW)) {
@@ -1134,6 +1136,7 @@ public class VideoPlayerActivity extends Activity {
} else if(getIntent().getExtras() != null) {
/* Started from VideoListActivity */
mLocation = getIntent().getExtras().getString("itemLocation");
+ itemTitle = getIntent().getExtras().getString("itemTitle");
dontParse = getIntent().getExtras().getBoolean("dontParse");
}
@@ -1156,7 +1159,9 @@ public class VideoPlayerActivity extends Activity {
if (dotIndex != -1)
title = title.substring(0, dotIndex);
}
- mTitle.setText(title);
+ } else if(itemTitle != null) {
+ title = itemTitle;
}
+ mTitle.setText(title);
}
}
More information about the Android
mailing list