1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-21 18:42:35 +01:00

Set the title for external video players.

This commit is contained in:
Chris Gahan 2015-09-23 21:58:41 -04:00
parent 4f24d61c4b
commit ac710fff08

View File

@ -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);