diff --git a/materialious/android/.project b/materialious/android/.project
new file mode 100644
index 00000000..13c3b2d2
--- /dev/null
+++ b/materialious/android/.project
@@ -0,0 +1,28 @@
+
+
+ android
+ Project android created by Buildship.
+
+
+
+
+ org.eclipse.buildship.core.gradleprojectbuilder
+
+
+
+
+
+ org.eclipse.buildship.core.gradleprojectnature
+
+
+
+ 1757025089541
+
+ 30
+
+ org.eclipse.core.resources.regexFilterMatcher
+ node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__
+
+
+
+
diff --git a/materialious/android/app/build.gradle b/materialious/android/app/build.gradle
index b43d6a5f..c11af414 100644
--- a/materialious/android/app/build.gradle
+++ b/materialious/android/app/build.gradle
@@ -7,8 +7,8 @@ android {
applicationId "us.materialio.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 146
- versionName "1.10.5"
+ versionCode 147
+ versionName "1.10.6"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
diff --git a/materialious/electron/materialious.metainfo.xml b/materialious/electron/materialious.metainfo.xml
index 84f5c871..b8a272d9 100644
--- a/materialious/electron/materialious.metainfo.xml
+++ b/materialious/electron/materialious.metainfo.xml
@@ -63,7 +63,11 @@
-
+
+
+ https://github.com/Materialious/Materialious/releases/tag/1.10.6
+
+
https://github.com/Materialious/Materialious/releases/tag/1.10.5
diff --git a/materialious/electron/package-lock.json b/materialious/electron/package-lock.json
index 0381e93e..2b453a3e 100644
--- a/materialious/electron/package-lock.json
+++ b/materialious/electron/package-lock.json
@@ -11,7 +11,6 @@
"dependencies": {
"@capacitor-community/electron": "^5.0.0",
"bgutils-js": "^3.2.0",
- "capacitor-nodejs": "https://github.com/hampoelz/capacitor-nodejs/releases/download/v1.0.0-beta.9/capacitor-nodejs.tgz",
"chokidar": "~4.0.3",
"electron-is-dev": "~2.0.0",
"electron-serve": "~1.1.0",
@@ -1798,15 +1797,6 @@
"node": ">= 0.4"
}
},
- "node_modules/capacitor-nodejs": {
- "version": "1.0.0-beta.9",
- "resolved": "https://github.com/hampoelz/capacitor-nodejs/releases/download/v1.0.0-beta.9/capacitor-nodejs.tgz",
- "integrity": "sha512-4EU/QBolfuyHiMtwd1nxZ4wsK243tGE4VttKvVBG+x1yQuK9EIlEf3lbRjFXfjrJMTZNCqaP6glmdfj9Zo7KVg==",
- "license": "MIT",
- "peerDependencies": {
- "@capacitor/core": ">=7.0.0"
- }
- },
"node_modules/chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
diff --git a/materialious/electron/package.json b/materialious/electron/package.json
index b13a61a5..4b4993a4 100644
--- a/materialious/electron/package.json
+++ b/materialious/electron/package.json
@@ -1,6 +1,6 @@
{
"name": "Materialious",
- "version": "1.10.5",
+ "version": "1.10.6",
"description": "Modern material design for Invidious.",
"author": {
"name": "Ward Pearce",
@@ -24,7 +24,6 @@
"dependencies": {
"@capacitor-community/electron": "^5.0.0",
"bgutils-js": "^3.2.0",
- "capacitor-nodejs": "https://github.com/hampoelz/capacitor-nodejs/releases/download/v1.0.0-beta.9/capacitor-nodejs.tgz",
"chokidar": "~4.0.3",
"electron-is-dev": "~2.0.0",
"electron-serve": "~1.1.0",
diff --git a/materialious/electron/src/rt/electron-plugins.js b/materialious/electron/src/rt/electron-plugins.js
index 5f312366..b33b2826 100644
--- a/materialious/electron/src/rt/electron-plugins.js
+++ b/materialious/electron/src/rt/electron-plugins.js
@@ -1,6 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
-const CapacitorNodejs = require('../../../node_modules/capacitor-nodejs/electron/dist/plugin.js');
module.exports = {
- CapacitorNodejs,
}
\ No newline at end of file
diff --git a/materialious/package.json b/materialious/package.json
index 8dad0133..5fc93cd1 100644
--- a/materialious/package.json
+++ b/materialious/package.json
@@ -1,6 +1,6 @@
{
"name": "materialious",
- "version": "1.10.5",
+ "version": "1.10.6",
"private": true,
"scripts": {
"dev": "vite dev",
@@ -69,4 +69,4 @@
"svelte-persisted-store": "^0.12.0",
"youtubei.js": "^15.0.0"
}
-}
+}
\ No newline at end of file
diff --git a/materialious/src/lib/components/Player.svelte b/materialious/src/lib/components/Player.svelte
index d5ec5a24..0bb8a201 100644
--- a/materialious/src/lib/components/Player.svelte
+++ b/materialious/src/lib/components/Player.svelte
@@ -551,6 +551,63 @@
await androidHandleRotate();
+ if ('mediaSession' in navigator) {
+ const metadataArtwork: MediaImage[] = [];
+ data.video.videoThumbnails.forEach((thumbnail) => {
+ metadataArtwork.push({
+ type: 'image/jpeg',
+ sizes: `${thumbnail.width}x${thumbnail.height}`,
+ src: thumbnail.url
+ });
+ });
+
+ console.log(metadataArtwork);
+
+ navigator.mediaSession.metadata = new MediaMetadata({
+ title: data.video.title,
+ artist: data.video.author,
+ artwork: metadataArtwork
+ });
+
+ navigator.mediaSession.setActionHandler('play', () => playerElement?.play());
+
+ navigator.mediaSession.setActionHandler('pause', () => playerElement?.pause());
+
+ navigator.mediaSession.setActionHandler('seekbackward', (details) => {
+ if (!playerElement) return;
+
+ playerElement.currentTime = Math.max(
+ playerElement.currentTime - (details.seekOffset || 10),
+ 0
+ );
+ });
+
+ navigator.mediaSession.setActionHandler('seekforward', (details) => {
+ if (!playerElement) return;
+
+ playerElement.currentTime = Math.min(
+ playerElement.currentTime + (details.seekOffset || 10),
+ playerElement.duration
+ );
+ });
+
+ navigator.mediaSession.setActionHandler('seekto', (details) => {
+ if (!playerElement) return;
+
+ if (details.fastSeek && 'fastSeek' in playerElement) {
+ playerElement.fastSeek(details.seekTime ?? 0);
+ } else {
+ playerElement.currentTime = details.seekTime ?? 0;
+ }
+ });
+
+ navigator.mediaSession.setActionHandler('stop', () => {
+ if (!playerElement) return;
+ playerElement.pause();
+ playerElement.currentTime = 0;
+ });
+ }
+
Mousetrap.bind('space', () => {
if (!playerElement) return;
diff --git a/materialious/src/lib/components/Thumbnail.svelte b/materialious/src/lib/components/Thumbnail.svelte
index b1101c95..0c6e9709 100644
--- a/materialious/src/lib/components/Thumbnail.svelte
+++ b/materialious/src/lib/components/Thumbnail.svelte
@@ -7,7 +7,7 @@
import { get } from 'svelte/store';
import { getDeArrow, getThumbnail } from '../api';
import type { Notification, PlaylistPageVideo, Video, VideoBase } from '../api/model';
- import { insecureRequestImageHandler, truncate } from '../misc';
+ import { insecureRequestImageHandler } from '../misc';
import type { PlayerEvents } from '../player';
import {
authStore,
diff --git a/update_versions.py b/update_versions.py
index 557d9af2..cb614caf 100644
--- a/update_versions.py
+++ b/update_versions.py
@@ -3,7 +3,7 @@ import os
import re
from datetime import datetime
-LATEST_VERSION = "1.10.5"
+LATEST_VERSION = "1.10.6"
RELEASE_DATE = datetime.now().strftime("%Y-%-m-%d") # Format: YYYY-M-D
WORKING_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "materialious")