Skip to content

Commit

Permalink
Merge pull request #43 from epitron/master
Browse files Browse the repository at this point in the history
Set the title for external video players
  • Loading branch information
theScrabi committed Sep 25, 2015
2 parents 1b9f7a7 + ac710ff commit d8bdada
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/src/main/java/org/schabi/newpipe/ActionBarHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,17 @@ public void playVideo() {
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();
Expand All @@ -229,6 +235,7 @@ public void onClick(DialogInterface dialog, int which) {
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);
Expand Down

0 comments on commit d8bdada

Please sign in to comment.