mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-09-26 19:00:51 +02:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b7c0a77edc | ||
![]() |
aab0f45890 | ||
![]() |
c62ad66f11 | ||
![]() |
d8bdada9db | ||
![]() |
1b9f7a7654 | ||
![]() |
ac710fff08 | ||
![]() |
2e09492eef |
@@ -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);
|
||||
@@ -303,6 +310,8 @@ public class ActionBarHandler {
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
intent.setDataAndType(Uri.parse(audioStream.url),
|
||||
VideoInfo.getMimeById(audioStream.format));
|
||||
intent.putExtra(Intent.EXTRA_TITLE, videoTitle);
|
||||
intent.putExtra("title", videoTitle);
|
||||
context.startActivity(intent); // HERE !!!
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
@@ -1,6 +1,8 @@
|
||||
package org.schabi.newpipe;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
@@ -72,6 +74,9 @@ public class PlayVideoActivity extends AppCompatActivity {
|
||||
private boolean isLandscape = true;
|
||||
private boolean hasSoftKeys = false;
|
||||
|
||||
private SharedPreferences prefs;
|
||||
private static final String PREF_IS_LANDSCAPE = "is_landscape";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -136,12 +141,16 @@ public class PlayVideoActivity extends AppCompatActivity {
|
||||
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
|
||||
prefs = getPreferences(Context.MODE_PRIVATE);
|
||||
if(prefs.getBoolean(PREF_IS_LANDSCAPE, false) && !isLandscape) {
|
||||
toggleOrientation();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostCreate(Bundle savedInstanceState) {
|
||||
super.onPostCreate(savedInstanceState);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -179,14 +188,7 @@ public class PlayVideoActivity extends AppCompatActivity {
|
||||
startActivity(Intent.createChooser(intent, getString(R.string.shareDialogTitle)));
|
||||
break;
|
||||
case R.id.menu_item_screen_rotation:
|
||||
Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay();
|
||||
if(display.getRotation() == Surface.ROTATION_0
|
||||
|| display.getRotation() == Surface.ROTATION_180) {
|
||||
setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||
} else if(display.getRotation() == Surface.ROTATION_90
|
||||
|| display.getRotation() == Surface.ROTATION_270) {
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
||||
}
|
||||
toggleOrientation();
|
||||
break;
|
||||
default:
|
||||
Log.e(TAG, "Error: MenuItem not known");
|
||||
@@ -319,4 +321,17 @@ public class PlayVideoActivity extends AppCompatActivity {
|
||||
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
|
||||
return displayMetrics.heightPixels < displayMetrics.widthPixels;
|
||||
}
|
||||
|
||||
private void toggleOrientation() {
|
||||
if(isLandscape) {
|
||||
isLandscape = false;
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
||||
} else {
|
||||
isLandscape = true;
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
|
||||
}
|
||||
SharedPreferences.Editor editor = prefs.edit();
|
||||
editor.putBoolean(PREF_IS_LANDSCAPE, isLandscape);
|
||||
editor.commit();
|
||||
}
|
||||
}
|
||||
|
@@ -146,7 +146,6 @@ public class VideoItemListActivity extends AppCompatActivity
|
||||
|
||||
SettingsActivity.initSettings(this);
|
||||
|
||||
// TODO: If exposing deep links into your app, handle intents here.
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -35,7 +35,7 @@
|
||||
<string name="fdroidKoreUrl">https://f-droid.org/repository/browse/?fdfilter=Kore&fdid=org.xbmc.kore</string>
|
||||
<string name="showPlayWithKodiTitle">Zeige \"Mit Kodi abspielen\" Option</string>
|
||||
<string name="showPlayWithKodiSummary">Zeigt eine Option an, über die man Videos mit dem Kodi Mediacenter abspielen kann.</string>
|
||||
<string name="leftHandLayoutTitle">Linkshänder freundliches Layout.</string>
|
||||
<string name="leftPlayButtonTitle">Zeige play button auf der linken seite.</string>
|
||||
<string name="playAudio">Audio</string>
|
||||
<string name="defaultAudioFormatTitle">Bevorzugtes Audio Format</string>
|
||||
<string name="webMAudioDescription">WebM - freies Format</string>
|
||||
|
@@ -35,4 +35,14 @@
|
||||
<string name="fdroidKoreUrl">https://f-droid.org/repository/browse/?fdfilter=Kore&fdid=org.xbmc.kore</string>
|
||||
<string name="showPlayWithKodiTitle">\"Lejátszás Kodi-val\" opció mutatása</string>
|
||||
<string name="showPlayWithKodiSummary">Mutat egy opciót a videók Kodi médiaközponttal való lejátszására</string>
|
||||
<string name="leftPlayButtonTitle">Lejátszás gomb bal oldalon mutatása</string>
|
||||
<string name="playAudio">Hang</string>
|
||||
<string name="defaultAudioFormatTitle">Alapértelmezett hang formátum</string>
|
||||
<string name="webMAudioDescription">WebM - szabad formátum</string>
|
||||
<string name="m4aAudioDescription">m4a - jobb minőség</string>
|
||||
<string name="downloadDialogTitle">Letöltés</string>
|
||||
<string-array name="downloadOptions">
|
||||
<item>Videó</item>
|
||||
<item>Hang</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
|
@@ -35,7 +35,7 @@
|
||||
<string name="fdroidKoreUrl">https://f-droid.org/repository/browse/?fdfilter=Kore&fdid=org.xbmc.kore</string>
|
||||
<string name="showPlayWithKodiTitle">Show \"Play with Kodi\" option</string>
|
||||
<string name="showPlayWithKodiSummary">Displays an option to play a video via Kodi media center.</string>
|
||||
<string name="leftHandLayoutTitle">Left hand friendly layout.</string>
|
||||
<string name="leftPlayButtonTitle">Show play button on the left side.</string>
|
||||
<string name="playAudio">Audio</string>
|
||||
<string name="defaultAudioFormatTitle">Default audio format</string>
|
||||
<string name="webMAudioDescription">WebM - free format</string>
|
||||
|
@@ -36,7 +36,7 @@
|
||||
|
||||
<CheckBoxPreference
|
||||
android:key="@string/leftHandLayout"
|
||||
android:title="@string/leftHandLayoutTitle"
|
||||
android:title="@string/leftPlayButtonTitle"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<ListPreference
|
||||
|
Reference in New Issue
Block a user