Merge pull request #536 from Materialious/update/1.3.3

Add fix for dash quality
This commit is contained in:
Ward
2024-09-15 19:33:23 +12:00
committed by GitHub
6 changed files with 49 additions and 6 deletions
+2 -2
View File
@@ -7,8 +7,8 @@ android {
applicationId "us.materialio.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 31
versionName "1.3.2"
versionCode 32
versionName "1.3.3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "Materialious",
"version": "1.3.2",
"version": "1.3.3",
"description": "Modern material design for Invidious.",
"author": {
"name": "Ward Pearce",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "materialious",
"version": "1.3.2",
"version": "1.3.3",
"private": true,
"scripts": {
"dev": "vite dev",
+31 -1
View File
@@ -12,7 +12,13 @@
import type { MediaPlayerElement } from 'vidstack/elements';
import { deleteVideoProgress, getVideoProgress, saveVideoProgress } from './Api';
import type { VideoPlay } from './Api/model';
import { getBestThumbnail, proxyVideoUrl, videoLength, type PhasedDescription } from './misc';
import {
getBestThumbnail,
proxyVideoUrl,
pullBitratePreference,
videoLength,
type PhasedDescription
} from './misc';
import {
authStore,
instanceStore,
@@ -205,6 +211,29 @@
userVideoSpeed = player.playbackRate;
});
player.addEventListener('provider-change', (event) => {
const provider = event.detail;
const bitrate = pullBitratePreference();
if (provider?.type === 'dash') {
(provider as any).config = {
streaming: {
abr: {
ABRStrategy: 'abrBola',
movingAverageMethod: 'ewma',
autoSwitchBitrate: {
video: false,
audio: false
},
initialBitrate: {
video: bitrate,
audio: bitrate
}
}
}
};
}
});
if (get(sponsorBlockStore) && get(sponsorBlockCategoriesStore)) {
const currentCategories = get(sponsorBlockCategoriesStore);
@@ -382,6 +411,7 @@
title={data.video.title}
streamType={playerIsLive ? 'live' : 'on-demand'}
viewType={audioMode ? 'audio' : 'video'}
fullscreen={false}
keep-alive
{src}
>
+13
View File
@@ -175,6 +175,19 @@ export async function loadPfp(url: string): Promise<string> {
return URL.createObjectURL(await resp.blob());
}
export function pullBitratePreference(): number {
const vidstack = localStorage.getItem('video-player');
if (vidstack) {
const vidstackSettings = JSON.parse(vidstack);
if (vidstackSettings.quality && vidstackSettings.quality.bitrate) {
return vidstackSettings.quality.bitrate;
}
}
return -1;
}
export function proxyGoogleImage(source: string): string {
if (source.startsWith('//')) source = `https:${source}`;
+1 -1
View File
@@ -5,7 +5,7 @@ import json
import os
import re
LATEST_VERSION = "1.3.2"
LATEST_VERSION = "1.3.3"
WORKING_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "materialious")
ROOT_PACKAGE = os.path.join(WORKING_DIR, "package.json")