Compare commits

...

12 Commits

Author SHA1 Message Date
CodeDevMLH
f69f676a68 Update manifest.json for release v1.6.1.19 [skip ci] 2026-02-13 18:44:00 +00:00
CodeDevMLH
f448c89ef2 Bump version to 1.6.1.19
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 54s
2026-02-13 19:43:04 +01:00
CodeDevMLH
daf26fe53a Refactor slide playback logic to remove redundant checks and improve clarity 2026-02-13 19:42:49 +01:00
CodeDevMLH
26ef307838 Update manifest.json for release v1.6.1.18 [skip ci] 2026-02-13 18:35:24 +00:00
CodeDevMLH
c296483583 Bump version to 1.6.1.18
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 53s
2026-02-13 19:34:31 +01:00
CodeDevMLH
7992e20715 Refactor slide playback logic to improve active slide checks and remove commented code 2026-02-13 19:34:13 +01:00
CodeDevMLH
1ae59f5da5 Update manifest.json for release v1.6.1.17 [skip ci] 2026-02-13 13:49:23 +00:00
CodeDevMLH
92eaf91173 Bump version to 1.6.1.17
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 1m2s
2026-02-13 14:48:24 +01:00
CodeDevMLH
e7410ec22a Fix slideshow preloading logic to prevent redundant slide creation 2026-02-13 14:48:07 +01:00
CodeDevMLH
bb43d1e679 Update manifest.json for release v1.6.1.16 [skip ci] 2026-02-13 02:53:20 +00:00
CodeDevMLH
b6609d23a2 Bump version to 1.6.1.16
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 51s
2026-02-13 03:52:27 +01:00
CodeDevMLH
9d4cbf37d3 Refactor slideshow state management and improve video playback logic 2026-02-13 03:52:07 +01:00
3 changed files with 14 additions and 24 deletions

View File

@@ -12,7 +12,7 @@
<!-- <TreatWarningsAsErrors>false</TreatWarningsAsErrors> --> <!-- <TreatWarningsAsErrors>false</TreatWarningsAsErrors> -->
<Title>Jellyfin Media Bar Enhanced Plugin</Title> <Title>Jellyfin Media Bar Enhanced Plugin</Title>
<Authors>CodeDevMLH</Authors> <Authors>CodeDevMLH</Authors>
<Version>1.6.1.15</Version> <Version>1.6.1.19</Version>
<RepositoryUrl>https://github.com/CodeDevMLH/jellyfin-plugin-media-bar-enhanced</RepositoryUrl> <RepositoryUrl>https://github.com/CodeDevMLH/jellyfin-plugin-media-bar-enhanced</RepositoryUrl>
</PropertyGroup> </PropertyGroup>

View File

@@ -1490,7 +1490,6 @@ const VisibilityObserver = {
* Initializes visibility observer * Initializes visibility observer
*/ */
init() { init() {
// MARK: Mark
const observer = new MutationObserver(() => this.updateVisibility()); const observer = new MutationObserver(() => this.updateVisibility());
// let debounceTimer = null; // let debounceTimer = null;
// const observer = new MutationObserver(() => { // const observer = new MutationObserver(() => {
@@ -1742,16 +1741,8 @@ const SlideCreator = {
const slide = document.querySelector(`.slide[data-item-id="${itemId}"]`); const slide = document.querySelector(`.slide[data-item-id="${itemId}"]`);
const isVideoPlayerOpen = document.querySelector('.videoPlayerContainer') || document.querySelector('.youtubePlayerContainer'); const isVideoPlayerOpen = document.querySelector('.videoPlayerContainer') || document.querySelector('.youtubePlayerContainer');
if (slide && slide.classList.contains('active') && !document.hidden && (!isVideoPlayerOpen || isVideoPlayerOpen.classList.contains('hide'))) { if (slide && slide.classList.contains('active') && !document.hidden && (!isVideoPlayerOpen || isVideoPlayerOpen.classList.contains('hide'))) {
// MARK: mark event.target.playVideo();
// const currentIndex = STATE.slideshow.currentSlideIndex;
// const currentItemId = STATE.slideshow.itemIds[currentIndex];
// if (currentItemId !== itemId) {
// console.log(`Slide ${itemId} is no longer active (current: ${currentItemId}), aborting playback.`);
// event.target.mute(); // Mute just in case
// return;
// }
event.target.playVideo();
// Check if it actually started playing after a short delay (handling autoplay blocks) // Check if it actually started playing after a short delay (handling autoplay blocks)
const timeoutId = setTimeout(() => { const timeoutId = setTimeout(() => {
@@ -1827,11 +1818,6 @@ const SlideCreator = {
backdrop.addEventListener('play', (event) => { backdrop.addEventListener('play', (event) => {
const slide = document.querySelector(`.slide[data-item-id="${itemId}"]`); const slide = document.querySelector(`.slide[data-item-id="${itemId}"]`);
// MARK: mark
// const currentIndex = STATE.slideshow.currentSlideIndex;
// const currentItemId = STATE.slideshow.itemIds[currentIndex];
// if (!slide || !slide.classList.contains('active') || currentItemId !== itemId) {
if (!slide || !slide.classList.contains('active')) { if (!slide || !slide.classList.contains('active')) {
console.log(`Local video ${itemId} started playing but is not active, pausing.`); console.log(`Local video ${itemId} started playing but is not active, pausing.`);
@@ -2318,8 +2304,6 @@ const SlideshowManager = {
} }
currentSlide.classList.add("active"); currentSlide.classList.add("active");
STATE.slideshow.currentSlideIndex = index;
// Restore focus for TV mode navigation continuity // Restore focus for TV mode navigation continuity
requestAnimationFrame(() => { requestAnimationFrame(() => {
@@ -2354,6 +2338,8 @@ const SlideshowManager = {
if (logo) logo.classList.add("animate"); if (logo) logo.classList.add("animate");
} }
STATE.slideshow.currentSlideIndex = index;
if (index === 0 || !previousVisibleSlide) { if (index === 0 || !previousVisibleSlide) {
const dotsContainer = container.querySelector(".dots-container"); const dotsContainer = container.querySelector(".dots-container");
if (dotsContainer) { if (dotsContainer) {
@@ -2437,6 +2423,8 @@ const SlideshowManager = {
// Preload next slides // Preload next slides
for (let i = 1; i <= preloadCount; i++) { for (let i = 1; i <= preloadCount; i++) {
const nextIndex = (currentIndex + i) % totalItems; const nextIndex = (currentIndex + i) % totalItems;
if (nextIndex === currentIndex) break;
const itemId = STATE.slideshow.itemIds[nextIndex]; const itemId = STATE.slideshow.itemIds[nextIndex];
SlideCreator.createSlideForItemId(itemId); SlideCreator.createSlideForItemId(itemId);
} }
@@ -2444,6 +2432,8 @@ const SlideshowManager = {
// Preload previous slides // Preload previous slides
for (let i = 1; i <= preloadCount; i++) { for (let i = 1; i <= preloadCount; i++) {
const prevIndex = (currentIndex - i + totalItems) % totalItems; const prevIndex = (currentIndex - i + totalItems) % totalItems;
if (prevIndex === currentIndex) break;
const prevItemId = STATE.slideshow.itemIds[prevIndex]; const prevItemId = STATE.slideshow.itemIds[prevIndex];
SlideCreator.createSlideForItemId(prevItemId); SlideCreator.createSlideForItemId(prevItemId);
} }
@@ -2719,7 +2709,7 @@ const SlideshowManager = {
} }
// YouTube player // YouTube player
const player = STATE.slideshow.videoPlayers?.[itemId]; const player = STATE.slideshow.videoPlayers && STATE.slideshow.videoPlayers[itemId];
if (player && typeof player.loadVideoById === 'function' && player._videoId) { if (player && typeof player.loadVideoById === 'function' && player._videoId) {
player.loadVideoById({ player.loadVideoById({
videoId: player._videoId, videoId: player._videoId,

View File

@@ -9,12 +9,12 @@
"imageUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/raw/branch/main/logo.png", "imageUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/raw/branch/main/logo.png",
"versions": [ "versions": [
{ {
"version": "1.6.1.15", "version": "1.6.1.19",
"changelog": "- fix tv mode issue\n- refactor video playback management", "changelog": "- fix tv mode issue\n- refactor video playback management",
"targetAbi": "10.11.0.0", "targetAbi": "10.11.0.0",
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.6.1.15/Jellyfin.Plugin.MediaBarEnhanced.zip", "sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.6.1.19/Jellyfin.Plugin.MediaBarEnhanced.zip",
"checksum": "b47caa7d04018d3cec864c1ab342c5f5", "checksum": "5eb7e552e1a1c250560f66ce71bab4cf",
"timestamp": "2026-02-13T02:41:24Z" "timestamp": "2026-02-13T18:43:59Z"
}, },
{ {
"version": "1.6.0.2", "version": "1.6.0.2",