From ac710fff08b4fa8f8c3805bae09d98055aa1199a Mon Sep 17 00:00:00 2001 From: Chris Gahan Date: Wed, 23 Sep 2015 21:58:41 -0400 Subject: [PATCH] Set the title for external video players. --- app/src/main/java/org/schabi/newpipe/ActionBarHandler.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/ActionBarHandler.java b/app/src/main/java/org/schabi/newpipe/ActionBarHandler.java index 0be35c11f..f135903a2 100644 --- a/app/src/main/java/org/schabi/newpipe/ActionBarHandler.java +++ b/app/src/main/java/org/schabi/newpipe/ActionBarHandler.java @@ -201,11 +201,17 @@ public class ActionBarHandler { if(!videoTitle.isEmpty()) { if (PreferenceManager.getDefaultSharedPreferences(context) .getBoolean(context.getString(R.string.useExternalPlayer), false)) { + + // External Player Intent intent = new Intent(); try { intent.setAction(Intent.ACTION_VIEW); + intent.setDataAndType(Uri.parse(videoStreams[selectedStream].url), VideoInfo.getMimeById(videoStreams[selectedStream].format)); + intent.putExtra(Intent.EXTRA_TITLE, videoTitle); + intent.putExtra("title", videoTitle); + context.startActivity(intent); // HERE !!! } catch (Exception e) { e.printStackTrace(); @@ -229,6 +235,7 @@ public class ActionBarHandler { builder.create().show(); } } else { + // Internal Player Intent intent = new Intent(context, PlayVideoActivity.class); intent.putExtra(PlayVideoActivity.VIDEO_TITLE, videoTitle); intent.putExtra(PlayVideoActivity.STREAM_URL, videoStreams[selectedStream].url);