Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9896044988 | ||
|
|
93e91e2e60 | ||
|
|
b613b028d0 | ||
|
|
9906784845 | ||
|
|
009a3c4720 | ||
|
|
595056230a | ||
|
|
b18060dfd7 | ||
|
|
ebb2af9d24 | ||
|
|
743af20b8e | ||
|
|
9844b186d7 | ||
|
|
104b76aa41 | ||
|
|
7493c8fa93 | ||
|
|
77c03157a1 | ||
|
|
a7929e1ff6 | ||
|
|
c78e07de62 | ||
|
|
a90f805ea8 |
@@ -36,6 +36,7 @@ namespace Jellyfin.Plugin.MediaBarEnhanced.Configuration
|
|||||||
public bool EnableSeasonalContent { get; set; } = false;
|
public bool EnableSeasonalContent { get; set; } = false;
|
||||||
public bool IsEnabled { get; set; } = true;
|
public bool IsEnabled { get; set; } = true;
|
||||||
public bool EnableClientSideSettings { get; set; } = false;
|
public bool EnableClientSideSettings { get; set; } = false;
|
||||||
|
public bool ApplyLimitsToCustomIds { get; set; } = false;
|
||||||
public string SortBy { get; set; } = "Random";
|
public string SortBy { get; set; } = "Random";
|
||||||
public string SortOrder { get; set; } = "Ascending";
|
public string SortOrder { get; set; } = "Ascending";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,12 +107,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="checkboxContainer checkboxContainer-withDescription">
|
<div class="checkboxContainer checkboxContainer-withDescription">
|
||||||
<label>
|
<label>
|
||||||
<input is="emby-checkbox" type="checkbox" id="EnableSeasonalContent"
|
<input is="emby-checkbox" type="checkbox" id="ApplyLimitsToCustomIds"
|
||||||
name="EnableSeasonalContent" />
|
name="ApplyLimitsToCustomIds" />
|
||||||
<span>Enable Seasonal Content Mode</span>
|
<span>Apply Limits to Custom IDs</span>
|
||||||
</label>
|
</label>
|
||||||
<div class="fieldDescription">Enable this to define time-based lists in the field below.
|
<div class="fieldDescription">If enabled, the Max Items limit (Advanced → Content Limits) will also apply to Custom Media IDs and Collections. By default, custom lists are not limited.</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="inputContainer">
|
<div class="inputContainer">
|
||||||
<label class="inputLabel inputLabelUnfocused" for="CustomMediaIds">Media/Collection/Playlist
|
<label class="inputLabel inputLabelUnfocused" for="CustomMediaIds">Media/Collection/Playlist
|
||||||
@@ -411,7 +410,7 @@
|
|||||||
'ShowTrailerButton', 'AlwaysShowArrows', 'EnableKeyboardControls',
|
'ShowTrailerButton', 'AlwaysShowArrows', 'EnableKeyboardControls',
|
||||||
'EnableCustomMediaIds', 'CustomMediaIds', 'EnableLoadingScreen',
|
'EnableCustomMediaIds', 'CustomMediaIds', 'EnableLoadingScreen',
|
||||||
'EnableSeasonalContent', 'EnableClientSideSettings', 'SortBy', 'SortOrder',
|
'EnableSeasonalContent', 'EnableClientSideSettings', 'SortBy', 'SortOrder',
|
||||||
'PreferLocalTrailers'
|
'PreferLocalTrailers', 'ApplyLimitsToCustomIds', 'SeasonalSections'
|
||||||
];
|
];
|
||||||
|
|
||||||
keys.forEach(function (key) {
|
keys.forEach(function (key) {
|
||||||
@@ -478,7 +477,7 @@
|
|||||||
'ShowTrailerButton', 'AlwaysShowArrows', 'EnableKeyboardControls',
|
'ShowTrailerButton', 'AlwaysShowArrows', 'EnableKeyboardControls',
|
||||||
'EnableCustomMediaIds', 'CustomMediaIds', 'EnableLoadingScreen',
|
'EnableCustomMediaIds', 'CustomMediaIds', 'EnableLoadingScreen',
|
||||||
'EnableSeasonalContent', 'EnableClientSideSettings', 'SortBy', 'SortOrder',
|
'EnableSeasonalContent', 'EnableClientSideSettings', 'SortBy', 'SortOrder',
|
||||||
'PreferLocalTrailers'
|
'PreferLocalTrailers', 'ApplyLimitsToCustomIds', 'SeasonalSections'
|
||||||
];
|
];
|
||||||
|
|
||||||
keys.forEach(function (key) {
|
keys.forEach(function (key) {
|
||||||
|
|||||||
@@ -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.3</Version>
|
<Version>1.6.1.8</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>
|
||||||
|
|
||||||
|
|||||||
@@ -175,6 +175,7 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#slides-container[style*="display: none"],
|
#slides-container[style*="display: none"],
|
||||||
@@ -999,14 +1000,3 @@
|
|||||||
.layout-tv .backdrop-container{
|
.layout-tv .backdrop-container{
|
||||||
top: -5%;
|
top: -5%;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* .layout-tv .video-backdrop {
|
|
||||||
mask-image: linear-gradient(to top,
|
|
||||||
#fff0 2%,
|
|
||||||
rgb(0 0 0 / 0.5) 6%,
|
|
||||||
#000000 8%);
|
|
||||||
-webkit-mask-image: linear-gradient(to top,
|
|
||||||
#fff0 2%,
|
|
||||||
rgb(0 0 0 / 0.5) 6%,
|
|
||||||
#000000 8%);
|
|
||||||
} */
|
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ const CONFIG = {
|
|||||||
enableClientSideSettings: false,
|
enableClientSideSettings: false,
|
||||||
sortBy: "Random",
|
sortBy: "Random",
|
||||||
sortOrder: "Ascending",
|
sortOrder: "Ascending",
|
||||||
|
applyLimitsToCustomIds: false,
|
||||||
|
seasonalSections: "[]",
|
||||||
};
|
};
|
||||||
|
|
||||||
// State management
|
// State management
|
||||||
@@ -611,7 +613,8 @@ const SlideUtils = {
|
|||||||
if (!container) {
|
if (!container) {
|
||||||
container = this.createElement("div", {
|
container = this.createElement("div", {
|
||||||
id: "slides-container",
|
id: "slides-container",
|
||||||
className: "noautofocus"
|
className: "noautofocus",
|
||||||
|
tabIndex: "-1"
|
||||||
});
|
});
|
||||||
document.body.appendChild(container);
|
document.body.appendChild(container);
|
||||||
}
|
}
|
||||||
@@ -1432,6 +1435,8 @@ const VisibilityObserver = {
|
|||||||
|
|
||||||
// If a full screen video player is active, hide slideshow and stop playback
|
// If a full screen video player is active, hide slideshow and stop playback
|
||||||
if ((videoPlayer && !videoPlayer.classList.contains('hide')) || (trailerPlayer && !trailerPlayer.classList.contains('hide'))) {
|
if ((videoPlayer && !videoPlayer.classList.contains('hide')) || (trailerPlayer && !trailerPlayer.classList.contains('hide'))) {
|
||||||
|
if (this._lastVisibleState !== 'player-active') {
|
||||||
|
this._lastVisibleState = 'player-active';
|
||||||
const container = document.getElementById("slides-container");
|
const container = document.getElementById("slides-container");
|
||||||
if (container) {
|
if (container) {
|
||||||
container.style.display = "none";
|
container.style.display = "none";
|
||||||
@@ -1442,6 +1447,7 @@ const VisibilityObserver = {
|
|||||||
STATE.slideshow.slideInterval.stop();
|
STATE.slideshow.slideInterval.stop();
|
||||||
}
|
}
|
||||||
SlideshowManager.stopAllPlayback();
|
SlideshowManager.stopAllPlayback();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1456,6 +1462,12 @@ const VisibilityObserver = {
|
|||||||
activeTab &&
|
activeTab &&
|
||||||
activeTab.getAttribute("data-index") === "0";
|
activeTab.getAttribute("data-index") === "0";
|
||||||
|
|
||||||
|
const newState = isVisible ? 'visible' : 'hidden';
|
||||||
|
|
||||||
|
// Only update DOM and trigger actions when state actually changes
|
||||||
|
if (this._lastVisibleState !== newState) {
|
||||||
|
this._lastVisibleState = newState;
|
||||||
|
|
||||||
container.style.display = isVisible ? "block" : "none";
|
container.style.display = isVisible ? "block" : "none";
|
||||||
container.style.visibility = isVisible ? "visible" : "hidden";
|
container.style.visibility = isVisible ? "visible" : "hidden";
|
||||||
container.style.pointerEvents = isVisible ? "auto" : "none";
|
container.style.pointerEvents = isVisible ? "auto" : "none";
|
||||||
@@ -1471,13 +1483,20 @@ const VisibilityObserver = {
|
|||||||
}
|
}
|
||||||
SlideshowManager.stopAllPlayback();
|
SlideshowManager.stopAllPlayback();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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;
|
||||||
|
// const observer = new MutationObserver(() => {
|
||||||
|
// if (debounceTimer) clearTimeout(debounceTimer);
|
||||||
|
// debounceTimer = setTimeout(() => this.updateVisibility(), 250);
|
||||||
|
// });
|
||||||
observer.observe(document.body, { childList: true, subtree: true });
|
observer.observe(document.body, { childList: true, subtree: true });
|
||||||
|
|
||||||
document.body.addEventListener("click", () => this.updateVisibility());
|
document.body.addEventListener("click", () => this.updateVisibility());
|
||||||
@@ -1700,6 +1719,7 @@ const SlideCreator = {
|
|||||||
const iframe = event.target.getIframe();
|
const iframe = event.target.getIframe();
|
||||||
if (iframe) {
|
if (iframe) {
|
||||||
iframe.setAttribute('tabindex', '-1');
|
iframe.setAttribute('tabindex', '-1');
|
||||||
|
iframe.setAttribute('inert', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store start/end time and videoId for later use
|
// Store start/end time and videoId for later use
|
||||||
@@ -1763,11 +1783,7 @@ const SlideCreator = {
|
|||||||
},
|
},
|
||||||
'onStateChange': (event) => {
|
'onStateChange': (event) => {
|
||||||
if (event.data === YT.PlayerState.ENDED) {
|
if (event.data === YT.PlayerState.ENDED) {
|
||||||
if (CONFIG.waitForTrailerToEnd) {
|
|
||||||
SlideshowManager.nextSlide();
|
SlideshowManager.nextSlide();
|
||||||
} else {
|
|
||||||
event.target.playVideo(); // Loop if not waiting for end if trailer is shorter than slide duration
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'onError': (event) => {
|
'onError': (event) => {
|
||||||
@@ -1825,9 +1841,7 @@ const SlideCreator = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
backdrop.addEventListener('ended', () => {
|
backdrop.addEventListener('ended', () => {
|
||||||
if (CONFIG.waitForTrailerToEnd) {
|
|
||||||
SlideshowManager.nextSlide();
|
SlideshowManager.nextSlide();
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
backdrop.addEventListener('error', () => {
|
backdrop.addEventListener('error', () => {
|
||||||
@@ -2455,6 +2469,7 @@ const SlideshowManager = {
|
|||||||
pruneSlideCache() {
|
pruneSlideCache() {
|
||||||
const currentIndex = STATE.slideshow.currentSlideIndex;
|
const currentIndex = STATE.slideshow.currentSlideIndex;
|
||||||
const keepRange = 5;
|
const keepRange = 5;
|
||||||
|
let prunedAny = false;
|
||||||
|
|
||||||
Object.keys(STATE.slideshow.createdSlides).forEach((itemId) => {
|
Object.keys(STATE.slideshow.createdSlides).forEach((itemId) => {
|
||||||
const index = STATE.slideshow.itemIds.indexOf(itemId);
|
const index = STATE.slideshow.itemIds.indexOf(itemId);
|
||||||
@@ -2486,10 +2501,27 @@ const SlideshowManager = {
|
|||||||
if (slide) slide.remove();
|
if (slide) slide.remove();
|
||||||
|
|
||||||
delete STATE.slideshow.createdSlides[itemId];
|
delete STATE.slideshow.createdSlides[itemId];
|
||||||
|
prunedAny = true;
|
||||||
|
|
||||||
console.log(`Pruned slide ${itemId} at distance ${distance} from view`);
|
console.log(`Pruned slide ${itemId} at distance ${distance} from view`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// After pruning, restore focus to container in TV mode
|
||||||
|
if (prunedAny) {
|
||||||
|
const isTvMode = (window.layoutManager && window.layoutManager.tv) ||
|
||||||
|
document.documentElement.classList.contains('layout-tv') ||
|
||||||
|
document.body.classList.contains('layout-tv');
|
||||||
|
if (isTvMode) {
|
||||||
|
// Use setTimeout to execute AFTER Jellyfin's focus manager processes the iframe removal
|
||||||
|
setTimeout(() => {
|
||||||
|
const container = document.getElementById("slides-container");
|
||||||
|
if (container && container.style.display !== 'none') {
|
||||||
|
container.focus({ preventScroll: true });
|
||||||
|
}
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
toggleMute() {
|
toggleMute() {
|
||||||
@@ -2772,8 +2804,26 @@ const SlideshowManager = {
|
|||||||
const currentSlide = document.querySelector(`.slide[data-item-id="${currentItemId}"]`);
|
const currentSlide = document.querySelector(`.slide[data-item-id="${currentItemId}"]`);
|
||||||
if (!currentSlide) return;
|
if (!currentSlide) return;
|
||||||
|
|
||||||
// Use playCurrentVideo to properly restore video with correct mute state
|
// YouTube player: just resume, don't reload
|
||||||
this.playCurrentVideo(currentSlide, currentItemId);
|
const ytPlayer = STATE.slideshow.videoPlayers?.[currentItemId];
|
||||||
|
if (ytPlayer && typeof ytPlayer.playVideo === 'function') {
|
||||||
|
if (STATE.slideshow.isMuted) {
|
||||||
|
if (typeof ytPlayer.mute === 'function') ytPlayer.mute();
|
||||||
|
} else {
|
||||||
|
if (typeof ytPlayer.unMute === 'function') ytPlayer.unMute();
|
||||||
|
if (typeof ytPlayer.setVolume === 'function') ytPlayer.setVolume(40);
|
||||||
|
}
|
||||||
|
ytPlayer.playVideo();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// HTML5 video: just resume, don't reset currentTime
|
||||||
|
const html5Video = currentSlide.querySelector('video.video-backdrop');
|
||||||
|
if (html5Video) {
|
||||||
|
html5Video.muted = STATE.slideshow.isMuted;
|
||||||
|
if (!STATE.slideshow.isMuted) html5Video.volume = 0.4;
|
||||||
|
html5Video.play().catch(e => console.warn("Error resuming HTML5 video:", e));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -3083,6 +3133,12 @@ const SlideshowManager = {
|
|||||||
console.log("Using Custom Media IDs from configuration");
|
console.log("Using Custom Media IDs from configuration");
|
||||||
const rawIds = this.parseCustomIds();
|
const rawIds = this.parseCustomIds();
|
||||||
itemIds = await this.resolveCollectionsAndItems(rawIds);
|
itemIds = await this.resolveCollectionsAndItems(rawIds);
|
||||||
|
|
||||||
|
// Apply max items limit to custom IDs if enabled
|
||||||
|
if (CONFIG.applyLimitsToCustomIds && itemIds.length > CONFIG.maxItems) {
|
||||||
|
console.log(`Limiting custom IDs from ${itemIds.length} to ${CONFIG.maxItems}`);
|
||||||
|
itemIds = itemIds.slice(0, CONFIG.maxItems);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Try Avatar List (list.txt)
|
// 2. Try Avatar List (list.txt)
|
||||||
@@ -3463,17 +3519,61 @@ const MediaBarEnhancedSettingsManager = {
|
|||||||
*/
|
*/
|
||||||
const initPageVisibilityHandler = () => {
|
const initPageVisibilityHandler = () => {
|
||||||
document.addEventListener("visibilitychange", () => {
|
document.addEventListener("visibilitychange", () => {
|
||||||
|
const isVideoPlayerOpen = document.querySelector('.videoPlayerContainer:not(.hide)') ||
|
||||||
|
document.querySelector('.youtubePlayerContainer:not(.hide)');
|
||||||
|
|
||||||
if (document.hidden) {
|
if (document.hidden) {
|
||||||
console.log("Tab inactive - stopping all slideshow playback");
|
// Stop slide timer
|
||||||
if (STATE.slideshow.slideInterval) {
|
if (STATE.slideshow.slideInterval) {
|
||||||
STATE.slideshow.slideInterval.stop();
|
STATE.slideshow.slideInterval.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isVideoPlayerOpen) {
|
||||||
|
// Jellyfin video is playing --> full stop to free all resources
|
||||||
|
console.log("Tab inactive and Jellyfin player active - stopping all playback");
|
||||||
SlideshowManager.stopAllPlayback();
|
SlideshowManager.stopAllPlayback();
|
||||||
} else {
|
} else {
|
||||||
console.log("Tab active - resuming slideshow");
|
// Simple tab switch: stop all others, pause only the current
|
||||||
// Only resume if we're on the home page and not paused
|
console.log("Tab inactive. Pausing current video, stopping others");
|
||||||
|
const currentItemId = STATE.slideshow.itemIds?.[STATE.slideshow.currentSlideIndex];
|
||||||
|
|
||||||
|
// Stop all players except the current one
|
||||||
|
if (STATE.slideshow.videoPlayers) {
|
||||||
|
Object.keys(STATE.slideshow.videoPlayers).forEach(id => {
|
||||||
|
if (id === currentItemId) return;
|
||||||
|
const p = STATE.slideshow.videoPlayers[id];
|
||||||
|
if (p) {
|
||||||
|
try {
|
||||||
|
if (typeof p.stopVideo === 'function') {
|
||||||
|
p.stopVideo();
|
||||||
|
if (typeof p.clearVideo === 'function') p.clearVideo();
|
||||||
|
} else if (p.tagName === 'VIDEO') {
|
||||||
|
p.pause();
|
||||||
|
p.muted = true;
|
||||||
|
p.currentTime = 0;
|
||||||
|
}
|
||||||
|
} catch (e) { console.warn("Error stopping background player", id, e); }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pause only the current video
|
||||||
|
if (currentItemId) {
|
||||||
|
const player = STATE.slideshow.videoPlayers?.[currentItemId];
|
||||||
|
if (player) {
|
||||||
|
try {
|
||||||
|
if (typeof player.pauseVideo === 'function') {
|
||||||
|
player.pauseVideo();
|
||||||
|
} else if (player.tagName === 'VIDEO') {
|
||||||
|
player.pause();
|
||||||
|
}
|
||||||
|
} catch (e) { console.warn("Error pausing video on tab hide:", e); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log("Tab active. Resuming slideshow");
|
||||||
const isOnHome = window.location.hash === "#/home.html" || window.location.hash === "#/home";
|
const isOnHome = window.location.hash === "#/home.html" || window.location.hash === "#/home";
|
||||||
const isVideoPlayerOpen = document.querySelector('.videoPlayerContainer:not(.hide)') || document.querySelector('.youtubePlayerContainer:not(.hide)');
|
|
||||||
|
|
||||||
if (isOnHome && !STATE.slideshow.isPaused && !isVideoPlayerOpen) {
|
if (isOnHome && !STATE.slideshow.isPaused && !isVideoPlayerOpen) {
|
||||||
SlideshowManager.resumeActivePlayback();
|
SlideshowManager.resumeActivePlayback();
|
||||||
|
|||||||
@@ -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.3",
|
"version": "1.6.1.8",
|
||||||
"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.3/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.6.1.8/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
||||||
"checksum": "e5c4f3d11b22621e013bdd0784cf35a6",
|
"checksum": "96db191473dc77edead21e8230c1115b",
|
||||||
"timestamp": "2026-02-12T00:43:52Z"
|
"timestamp": "2026-02-12T23:51:47Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "1.6.0.2",
|
"version": "1.6.0.2",
|
||||||
|
|||||||
Reference in New Issue
Block a user