1
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-09-26 19:00:51 +02:00

Compare commits

..

7 Commits

Author SHA1 Message Date
Christian Schabesberger
b7c0a77edc Merge pull request #45 from ata2001/master
Update hungarian translation
2015-09-25 23:33:01 +02:00
ata2001
aab0f45890 Update hungarian translation 2015-09-26 00:05:54 +02:00
Christian Schabesberger
c62ad66f11 New:
- Show video title instead of stream url in vlc/MXPlayer
 - remember rotation
Fix:
 - sensore controlled landscape rotation in the player
2015-09-25 14:17:43 +02:00
Christian Schabesberger
d8bdada9db Merge pull request #43 from epitron/master
Set the title for external video players
2015-09-25 07:43:46 +02:00
Christian Schabesberger
1b9f7a7654 Merge pull request #40 from ata2001/master
Update hungarian translation
2015-09-25 07:42:41 +02:00
Chris Gahan
ac710fff08 Set the title for external video players. 2015-09-23 21:58:41 -04:00
ata2001
2e09492eef Update hungarian translation 2015-09-23 19:01:09 +02:00
7 changed files with 46 additions and 13 deletions

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

View File

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

View File

@@ -146,7 +146,6 @@ public class VideoItemListActivity extends AppCompatActivity
SettingsActivity.initSettings(this);
// TODO: If exposing deep links into your app, handle intents here.
}
/**

View File

@@ -35,7 +35,7 @@
<string name="fdroidKoreUrl">https://f-droid.org/repository/browse/?fdfilter=Kore&amp;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>

View File

@@ -35,4 +35,14 @@
<string name="fdroidKoreUrl">https://f-droid.org/repository/browse/?fdfilter=Kore&amp;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>

View File

@@ -35,7 +35,7 @@
<string name="fdroidKoreUrl">https://f-droid.org/repository/browse/?fdfilter=Kore&amp;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>

View File

@@ -36,7 +36,7 @@
<CheckBoxPreference
android:key="@string/leftHandLayout"
android:title="@string/leftHandLayoutTitle"
android:title="@string/leftPlayButtonTitle"
android:defaultValue="false" />
<ListPreference