Merge pull request #784 from Materialious/update/1.7.2
Fixes to fullscreen logic
This commit is contained in:
@@ -7,8 +7,8 @@ android {
|
||||
applicationId "us.materialio.app"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 83
|
||||
versionName "1.7.1"
|
||||
versionCode 84
|
||||
versionName "1.7.2"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
aaptOptions {
|
||||
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Materialious",
|
||||
"version": "1.7.1",
|
||||
"version": "1.7.2",
|
||||
"description": "Modern material design for Invidious.",
|
||||
"author": {
|
||||
"name": "Ward Pearce",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "materialious",
|
||||
"version": "1.7.1",
|
||||
"version": "1.7.2",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
|
||||
@@ -367,12 +367,52 @@
|
||||
}
|
||||
});
|
||||
|
||||
if (
|
||||
Capacitor.getPlatform() === 'android' &&
|
||||
data.video.adaptiveFormats.length > 0 &&
|
||||
data.video.fallbackPatch === undefined
|
||||
) {
|
||||
if (get(playerAndroidBgPlayer)) {
|
||||
if (Capacitor.getPlatform() === 'android' && data.video.adaptiveFormats.length > 0) {
|
||||
const videoFormats = data.video.adaptiveFormats.filter((format) =>
|
||||
format.type.startsWith('video/')
|
||||
);
|
||||
|
||||
originalOrigination = await ScreenOrientation.orientation();
|
||||
|
||||
player.addEventListener('fullscreen-change', async (event: FullscreenChangeEvent) => {
|
||||
if (event.detail) {
|
||||
// Ensure bar color is black while in fullscreen
|
||||
await StatusBar.setBackgroundColor({ color: '#000000' });
|
||||
await NavigationBar.setColor({
|
||||
color: '#000000'
|
||||
});
|
||||
await StatusBar.setStyle({ style: Style.Dark });
|
||||
} else {
|
||||
await setStatusBarColor();
|
||||
}
|
||||
|
||||
if (!get(playerAndroidLockOrientation)) return;
|
||||
|
||||
if (event.detail && videoFormats[0].resolution) {
|
||||
const widthHeight = videoFormats[0].resolution.split('x');
|
||||
|
||||
if (widthHeight.length !== 2) return;
|
||||
|
||||
if (Number(widthHeight[0]) > Number(widthHeight[1])) {
|
||||
await StatusBar.setOverlaysWebView({ overlay: true });
|
||||
await StatusBar.hide();
|
||||
await NavigationBar.hide();
|
||||
await ScreenOrientation.lock({ orientation: 'landscape' });
|
||||
} else {
|
||||
await ScreenOrientation.lock({ orientation: 'portrait' });
|
||||
}
|
||||
} else {
|
||||
await StatusBar.setOverlaysWebView({ overlay: false });
|
||||
await StatusBar.show();
|
||||
await NavigationBar.show();
|
||||
|
||||
await ScreenOrientation.lock({
|
||||
orientation: (originalOrigination as ScreenOrientationResult).type
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (data.video.fallbackPatch === undefined && get(playerAndroidBgPlayer)) {
|
||||
const highestBitrateAudio = data.video.adaptiveFormats
|
||||
.filter((format) => format.type.startsWith('audio/'))
|
||||
.reduce((prev, current) => {
|
||||
@@ -424,50 +464,6 @@
|
||||
|
||||
await AudioPlayer.initialize(audioId);
|
||||
}
|
||||
|
||||
if (Capacitor.getPlatform() === 'android') {
|
||||
const videoFormats = data.video.adaptiveFormats.filter((format) =>
|
||||
format.type.startsWith('video/')
|
||||
);
|
||||
|
||||
originalOrigination = await ScreenOrientation.orientation();
|
||||
|
||||
player.addEventListener('fullscreen-change', async (event: FullscreenChangeEvent) => {
|
||||
if (event.detail) {
|
||||
// Ensure bar color is black while in fullscreen
|
||||
await StatusBar.setBackgroundColor({ color: '#000000' });
|
||||
await NavigationBar.setColor({
|
||||
color: '#000000'
|
||||
});
|
||||
await StatusBar.setStyle({ style: Style.Dark });
|
||||
} else {
|
||||
await setStatusBarColor();
|
||||
}
|
||||
|
||||
if (!get(playerAndroidLockOrientation)) return;
|
||||
|
||||
if (event.detail && videoFormats[0].resolution) {
|
||||
const widthHeight = videoFormats[0].resolution.split('x');
|
||||
|
||||
if (widthHeight.length !== 2) return;
|
||||
|
||||
if (Number(widthHeight[0]) > Number(widthHeight[1])) {
|
||||
await StatusBar.setOverlaysWebView({ overlay: true });
|
||||
await StatusBar.hide();
|
||||
await ScreenOrientation.lock({ orientation: 'landscape' });
|
||||
} else {
|
||||
await ScreenOrientation.lock({ orientation: 'portrait' });
|
||||
}
|
||||
} else {
|
||||
await StatusBar.setOverlaysWebView({ overlay: false });
|
||||
await StatusBar.show();
|
||||
|
||||
await ScreenOrientation.lock({
|
||||
orientation: (originalOrigination as ScreenOrientationResult).type
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
playerIsLive = true;
|
||||
|
||||
@@ -34,6 +34,8 @@ export async function setStatusBarColor() {
|
||||
darkButtons: !get(darkModeStore)
|
||||
});
|
||||
|
||||
await NavigationBar.show();
|
||||
|
||||
if (get(darkModeStore)) {
|
||||
await StatusBar.setStyle({ style: Style.Dark });
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import json
|
||||
import os
|
||||
import re
|
||||
|
||||
LATEST_VERSION = "1.7.1"
|
||||
LATEST_VERSION = "1.7.2"
|
||||
WORKING_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "materialious")
|
||||
|
||||
ROOT_PACKAGE = os.path.join(WORKING_DIR, "package.json")
|
||||
|
||||
Reference in New Issue
Block a user