Compare commits

..

6 Commits

Author SHA1 Message Date
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
3 changed files with 28 additions and 19 deletions

View File

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

View File

@@ -1490,7 +1490,6 @@ const VisibilityObserver = {
* Initializes visibility observer
*/
init() {
// MARK: Mark
const observer = new MutationObserver(() => this.updateVisibility());
// let debounceTimer = null;
// const observer = new MutationObserver(() => {
@@ -1744,14 +1743,15 @@ const SlideCreator = {
if (slide && slide.classList.contains('active') && !document.hidden && (!isVideoPlayerOpen || isVideoPlayerOpen.classList.contains('hide'))) {
// MARK: mark
// 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();
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)
const timeoutId = setTimeout(() => {
@@ -1828,12 +1828,12 @@ const SlideCreator = {
backdrop.addEventListener('play', (event) => {
const slide = document.querySelector(`.slide[data-item-id="${itemId}"]`);
// MARK: mark
// const currentIndex = STATE.slideshow.currentSlideIndex;
// const currentItemId = STATE.slideshow.itemIds[currentIndex];
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') || 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.`);
event.target.pause();
event.target.currentTime = 0;
@@ -2437,6 +2437,8 @@ const SlideshowManager = {
// Preload next slides
for (let i = 1; i <= preloadCount; i++) {
const nextIndex = (currentIndex + i) % totalItems;
if (nextIndex === currentIndex) break;
const itemId = STATE.slideshow.itemIds[nextIndex];
SlideCreator.createSlideForItemId(itemId);
}
@@ -2444,6 +2446,8 @@ const SlideshowManager = {
// Preload previous slides
for (let i = 1; i <= preloadCount; i++) {
const prevIndex = (currentIndex - i + totalItems) % totalItems;
if (prevIndex === currentIndex) break;
const prevItemId = STATE.slideshow.itemIds[prevIndex];
SlideCreator.createSlideForItemId(prevItemId);
}
@@ -2708,7 +2712,9 @@ const SlideshowManager = {
videoBackdrop.play().catch(() => {
setTimeout(() => {
if (videoBackdrop.paused) {
// MARK: mark
if (videoBackdrop.paused && slide.classList.contains('active')) {
// if (videoBackdrop.paused) {
console.warn(`Autoplay blocked for ${itemId}, attempting muted fallback`);
videoBackdrop.muted = true;
videoBackdrop.play().catch(err => console.error("Muted fallback failed", err));
@@ -2735,6 +2741,9 @@ const SlideshowManager = {
}
setTimeout(() => {
// MARK: mark
if (!slide.classList.contains('active')) return;
if (player.getPlayerState &&
player.getPlayerState() !== YT.PlayerState.PLAYING &&
player.getPlayerState() !== YT.PlayerState.BUFFERING) {

View File

@@ -9,12 +9,12 @@
"imageUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/raw/branch/main/logo.png",
"versions": [
{
"version": "1.6.1.16",
"version": "1.6.1.18",
"changelog": "- fix tv mode issue\n- refactor video playback management",
"targetAbi": "10.11.0.0",
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.6.1.16/Jellyfin.Plugin.MediaBarEnhanced.zip",
"checksum": "a478b0f9b3738f830a34cc0c3e1be78c",
"timestamp": "2026-02-13T02:53:19Z"
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.6.1.18/Jellyfin.Plugin.MediaBarEnhanced.zip",
"checksum": "d1bb3e651c2eda66fa52a8349568c534",
"timestamp": "2026-02-13T18:35:23Z"
},
{
"version": "1.6.0.2",