mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-23 00:20:32 +00:00
Merge pull request #43 from epitron/master
Set the title for external video players
This commit is contained in:
commit
d8bdada9db
@ -201,11 +201,17 @@ public class ActionBarHandler {
|
|||||||
if(!videoTitle.isEmpty()) {
|
if(!videoTitle.isEmpty()) {
|
||||||
if (PreferenceManager.getDefaultSharedPreferences(context)
|
if (PreferenceManager.getDefaultSharedPreferences(context)
|
||||||
.getBoolean(context.getString(R.string.useExternalPlayer), false)) {
|
.getBoolean(context.getString(R.string.useExternalPlayer), false)) {
|
||||||
|
|
||||||
|
// External Player
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
try {
|
try {
|
||||||
intent.setAction(Intent.ACTION_VIEW);
|
intent.setAction(Intent.ACTION_VIEW);
|
||||||
|
|
||||||
intent.setDataAndType(Uri.parse(videoStreams[selectedStream].url),
|
intent.setDataAndType(Uri.parse(videoStreams[selectedStream].url),
|
||||||
VideoInfo.getMimeById(videoStreams[selectedStream].format));
|
VideoInfo.getMimeById(videoStreams[selectedStream].format));
|
||||||
|
intent.putExtra(Intent.EXTRA_TITLE, videoTitle);
|
||||||
|
intent.putExtra("title", videoTitle);
|
||||||
|
|
||||||
context.startActivity(intent); // HERE !!!
|
context.startActivity(intent); // HERE !!!
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -229,6 +235,7 @@ public class ActionBarHandler {
|
|||||||
builder.create().show();
|
builder.create().show();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// Internal Player
|
||||||
Intent intent = new Intent(context, PlayVideoActivity.class);
|
Intent intent = new Intent(context, PlayVideoActivity.class);
|
||||||
intent.putExtra(PlayVideoActivity.VIDEO_TITLE, videoTitle);
|
intent.putExtra(PlayVideoActivity.VIDEO_TITLE, videoTitle);
|
||||||
intent.putExtra(PlayVideoActivity.STREAM_URL, videoStreams[selectedStream].url);
|
intent.putExtra(PlayVideoActivity.STREAM_URL, videoStreams[selectedStream].url);
|
||||||
|
Loading…
Reference in New Issue
Block a user