Release 1.1.1

This commit is contained in:
imeed166 2026-04-16 12:44:04 +01:00
parent 8add6d8c58
commit 40212be646
6 changed files with 52 additions and 4 deletions

8
RELEASE_NOTES_1.1.1.md Normal file
View file

@ -0,0 +1,8 @@
# Cross Player 1.1.1
This patch release improves the mobile overlay seek bar in dark mode.
Highlights:
- Fixed the overlay progress bar fill so it stays visible in dark mode.
- Kept the light mode progress bar appearance unchanged.
- Preserved the mobile overlay progress strip layout with time labels and fullscreen access.

19
main.js
View file

@ -4347,6 +4347,12 @@ var CrossPlayerMainView = class extends import_obsidian.ItemView {
progressBar.style.margin = "0";
progressBar.style.accentColor = "var(--interactive-accent)";
progressBar.style.touchAction = "none";
progressBar.style.height = "6px";
progressBar.style.borderRadius = "999px";
progressBar.style.setProperty("-webkit-appearance", "none");
progressBar.style.appearance = "none";
progressBar.style.outline = "none";
progressBar.style.border = "none";
this.overlayProgressEl = progressBar;
const durationEl = progressWrap.createSpan({ text: "0:00" });
durationEl.style.minWidth = "40px";
@ -4481,6 +4487,7 @@ var CrossPlayerMainView = class extends import_obsidian.ItemView {
if (!this.overlayProgressEl || !this.videoEl || !isFinite(this.videoEl.duration) || this.videoEl.duration <= 0) {
if (this.overlayProgressEl) {
this.overlayProgressEl.value = "0";
this.updateOverlayProgressTrack(0);
}
if (this.overlayCurrentTimeEl) {
this.overlayCurrentTimeEl.setText("0:00");
@ -4495,6 +4502,7 @@ var CrossPlayerMainView = class extends import_obsidian.ItemView {
}
const pct = Math.min(1, Math.max(0, this.videoEl.currentTime / this.videoEl.duration));
this.overlayProgressEl.value = String(Math.round(pct * 1e3));
this.updateOverlayProgressTrack(pct);
if (this.overlayCurrentTimeEl) {
this.overlayCurrentTimeEl.setText(this.formatPlaybackTime(this.videoEl.currentTime));
}
@ -4505,6 +4513,17 @@ var CrossPlayerMainView = class extends import_obsidian.ItemView {
(0, import_obsidian.setIcon)(this.overlayFullscreenBtn, document.fullscreenElement ? "minimize" : "maximize");
}
}
updateOverlayProgressTrack(progress) {
if (!this.overlayProgressEl)
return;
const normalized = Math.min(1, Math.max(0, progress));
const percent = (normalized * 100).toFixed(2);
const isDarkTheme = document.body.classList.contains("theme-dark");
const fillColor = "var(--interactive-accent)";
const trackColor = isDarkTheme ? "rgba(255, 255, 255, 0.22)" : "rgba(0, 0, 0, 0.10)";
this.overlayProgressEl.style.background = `linear-gradient(to right, ${fillColor} 0%, ${fillColor} ${percent}%, ${trackColor} ${percent}%, ${trackColor} 100%)`;
this.overlayProgressEl.style.boxShadow = isDarkTheme ? "0 0 0 1px rgba(255, 255, 255, 0.05) inset" : "none";
}
formatPlaybackTime(seconds) {
if (!isFinite(seconds) || seconds < 0)
return "0:00";

View file

@ -1,7 +1,7 @@
{
"id": "cross-player",
"name": "Cross Player",
"version": "1.1",
"version": "1.1.1",
"minAppVersion": "0.15.0",
"description": "A media player plugin that watches a folder and plays media.",
"author": "Imed Ghomari",

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "cross-player",
"version": "1.1",
"version": "1.1.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "cross-player",
"version": "1.1",
"version": "1.1.1",
"license": "MIT",
"dependencies": {
"@types/sortablejs": "^1.15.9",

View file

@ -1,6 +1,6 @@
{
"name": "cross-player",
"version": "1.1",
"version": "1.1.1",
"description": "Media player plugin for Obsidian",
"main": "main.js",
"scripts": {

View file

@ -2795,6 +2795,12 @@ class CrossPlayerMainView extends ItemView {
progressBar.style.margin = "0";
progressBar.style.accentColor = "var(--interactive-accent)";
progressBar.style.touchAction = "none";
progressBar.style.height = "6px";
progressBar.style.borderRadius = "999px";
progressBar.style.setProperty("-webkit-appearance", "none");
progressBar.style.appearance = "none";
progressBar.style.outline = "none";
progressBar.style.border = "none";
this.overlayProgressEl = progressBar;
const durationEl = progressWrap.createSpan({ text: "0:00" });
@ -2953,6 +2959,7 @@ class CrossPlayerMainView extends ItemView {
if (!this.overlayProgressEl || !this.videoEl || !isFinite(this.videoEl.duration) || this.videoEl.duration <= 0) {
if (this.overlayProgressEl) {
this.overlayProgressEl.value = '0';
this.updateOverlayProgressTrack(0);
}
if (this.overlayCurrentTimeEl) {
this.overlayCurrentTimeEl.setText("0:00");
@ -2968,6 +2975,7 @@ class CrossPlayerMainView extends ItemView {
const pct = Math.min(1, Math.max(0, this.videoEl.currentTime / this.videoEl.duration));
this.overlayProgressEl.value = String(Math.round(pct * 1000));
this.updateOverlayProgressTrack(pct);
if (this.overlayCurrentTimeEl) {
this.overlayCurrentTimeEl.setText(this.formatPlaybackTime(this.videoEl.currentTime));
}
@ -2979,6 +2987,19 @@ class CrossPlayerMainView extends ItemView {
}
}
updateOverlayProgressTrack(progress: number) {
if (!this.overlayProgressEl) return;
const normalized = Math.min(1, Math.max(0, progress));
const percent = (normalized * 100).toFixed(2);
const isDarkTheme = document.body.classList.contains('theme-dark');
const fillColor = "var(--interactive-accent)";
const trackColor = isDarkTheme ? "rgba(255, 255, 255, 0.22)" : "rgba(0, 0, 0, 0.10)";
this.overlayProgressEl.style.background = `linear-gradient(to right, ${fillColor} 0%, ${fillColor} ${percent}%, ${trackColor} ${percent}%, ${trackColor} 100%)`;
this.overlayProgressEl.style.boxShadow = isDarkTheme ? "0 0 0 1px rgba(255, 255, 255, 0.05) inset" : "none";
}
formatPlaybackTime(seconds: number): string {
if (!isFinite(seconds) || seconds < 0) return "0:00";