Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a70746e095 | ||
|
|
f32283e0bf | ||
|
|
8f3985f307 | ||
|
|
0b2817ecff | ||
|
|
84faee2db4 | ||
|
|
3efa07ec51 | ||
|
|
af603e8803 | ||
|
|
fe63414e4b | ||
|
|
614c86083f | ||
|
|
17b9e8921e | ||
|
|
5075226ba8 | ||
|
|
443fb1008b | ||
|
|
8f12140aad | ||
|
|
1469712bb5 | ||
|
|
76ff03ac17 | ||
|
|
25b1ba5f2b | ||
|
|
eed3ca1860 | ||
|
|
0f14577f5d | ||
|
|
9999d6a633 | ||
|
|
a935fd7d5d | ||
|
|
60293e81e1 | ||
|
|
f54e55fe04 | ||
|
|
b3c42e2100 | ||
|
|
20ddbb32c7 | ||
|
|
14a5075e22 | ||
|
|
accb316a81 | ||
|
|
51c5cdf5bf | ||
|
|
306eff757b | ||
|
|
b8f28a5735 | ||
|
|
0932d9611d | ||
|
|
5e616db0ae | ||
|
|
538b0f2110 | ||
|
|
e717c07c54 |
@@ -182,8 +182,7 @@
|
||||
</div>
|
||||
<div class="selectContainer">
|
||||
<label class="selectLabel" for="PreferredVideoQuality">Preferred YouTube Quality</label>
|
||||
<select is="emby-select" id="PreferredVideoQuality" name="PreferredVideoQuality"
|
||||
class="emby-select-withcolor emby-select">
|
||||
<select is="emby-select" id="PreferredVideoQuality" name="PreferredVideoQuality" class="selectLayout emby-select-withcolor emby-select">
|
||||
<option value="Auto">Auto (Smart)</option>
|
||||
<option value="Maximum">Maximum (4K+)</option>
|
||||
<option value="1080p">1080p</option>
|
||||
@@ -285,7 +284,7 @@
|
||||
<h2 class="sectionTitle">Content Sorting</h2>
|
||||
<div class="selectContainer">
|
||||
<label class="selectLabel" for="SortBy">Sort By</label>
|
||||
<select is="emby-select" id="SortBy" name="SortBy" class="emby-select-withcolor emby-select">
|
||||
<select is="emby-select" id="SortBy" name="SortBy" class="selectLayout emby-select-withcolor emby-select">
|
||||
<option value="Random">Random</option>
|
||||
<option value="Original">Original (Custom List Order)</option>
|
||||
<option value="PremiereDate">Premiere Date</option>
|
||||
@@ -299,7 +298,7 @@
|
||||
</div>
|
||||
<div class="selectContainer">
|
||||
<label class="selectLabel" for="SortOrder">Sort Order</label>
|
||||
<select is="emby-select" id="SortOrder" name="SortOrder" class="emby-select-withcolor emby-select">
|
||||
<select is="emby-select" id="SortOrder" name="SortOrder" class="selectLayout emby-select-withcolor emby-select">
|
||||
<option value="Ascending">Ascending</option>
|
||||
<option value="Descending">Descending</option>
|
||||
</select>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<!-- <TreatWarningsAsErrors>false</TreatWarningsAsErrors> -->
|
||||
<Title>Jellyfin Media Bar Enhanced Plugin</Title>
|
||||
<Authors>CodeDevMLH</Authors>
|
||||
<Version>1.5.0.17</Version>
|
||||
<Version>1.5.1.3</Version>
|
||||
<RepositoryUrl>https://github.com/CodeDevMLH/jellyfin-plugin-media-bar-enhanced</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Jellyfin Slideshow by M0RPH3US v3.0.9
|
||||
* Modified by CodeDevMLH v1.1.0.0
|
||||
* Jellyfin Slideshow by M0RPH3US v4.0.1
|
||||
* Modified by CodeDevMLH
|
||||
*
|
||||
* New features:
|
||||
* - optional Trailer background video support
|
||||
@@ -14,6 +14,9 @@
|
||||
* - option to disable loading screen
|
||||
* - option to put collection (boxsets) IDs into the slideshow to display their items
|
||||
* - option to enable client-side settings (allow users to override settings locally on their device)
|
||||
* - option to enable seasonal content (only show items that are relevant to the current season/holiday)
|
||||
* - option to prefer local trailers (from the media item) over online sources
|
||||
* - options to sort the content by various criteria (PremiereDate, ProductionYear, Random, Original order, etc.)
|
||||
*/
|
||||
|
||||
@import url(https://fonts.googleapis.com/css2?family=Archivo+Narrow:ital,wght@0,400..700;1,400..700&display=swap);
|
||||
@@ -161,7 +164,7 @@
|
||||
|
||||
.homeSectionsContainer {
|
||||
position: relative;
|
||||
margin-top: 65vh;
|
||||
top: 65vh;
|
||||
z-index: 6;
|
||||
}
|
||||
|
||||
@@ -991,4 +994,4 @@
|
||||
|
||||
.dots-container .slide-counter {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Jellyfin Slideshow by M0RPH3US v4.0.1
|
||||
* Modified by CodeDevMLH v1.1.0.0
|
||||
* Modified by CodeDevMLH
|
||||
*
|
||||
* New features:
|
||||
* - optional Trailer background video support
|
||||
@@ -14,6 +14,9 @@
|
||||
* - option to disable loading screen
|
||||
* - option to put collection (boxsets) IDs into the slideshow to display their items
|
||||
* - option to enable client-side settings (allow users to override settings locally on their device)
|
||||
* - option to enable seasonal content (only show items that are relevant to the current season/holiday)
|
||||
* - option to prefer local trailers (from the media item) over online sources
|
||||
* - options to sort the content by various criteria (PremiereDate, ProductionYear, Random, Original order, etc.)
|
||||
*/
|
||||
|
||||
//Core Module Configuration
|
||||
@@ -85,6 +88,7 @@ const STATE = {
|
||||
isMuted: CONFIG.startMuted,
|
||||
customTrailerUrls: {},
|
||||
ytPromise: null,
|
||||
autoplayTimeouts: [],
|
||||
},
|
||||
};
|
||||
|
||||
@@ -605,7 +609,10 @@ const SlideUtils = {
|
||||
getOrCreateSlidesContainer() {
|
||||
let container = document.getElementById("slides-container");
|
||||
if (!container) {
|
||||
container = this.createElement("div", { id: "slides-container" });
|
||||
container = this.createElement("div", {
|
||||
id: "slides-container",
|
||||
className: "noautofocus"
|
||||
});
|
||||
document.body.appendChild(container);
|
||||
}
|
||||
return container;
|
||||
@@ -733,7 +740,9 @@ const SlideUtils = {
|
||||
autoplay: 1,
|
||||
controls: 1,
|
||||
iv_load_policy: 3,
|
||||
rel: 0
|
||||
rel: 0,
|
||||
playsinline: 1,
|
||||
origin: window.location.origin
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -1413,6 +1422,24 @@ class SlideTimer {
|
||||
*/
|
||||
const VisibilityObserver = {
|
||||
updateVisibility() {
|
||||
const videoPlayer = document.querySelector('.videoPlayerContainer');
|
||||
const trailerPlayer = document.querySelector('.youtubePlayerContainer');
|
||||
|
||||
// If a full screen video player is active, hide slideshow and stop playback
|
||||
if ((videoPlayer && !videoPlayer.classList.contains('hide')) || (trailerPlayer && !trailerPlayer.classList.contains('hide'))) {
|
||||
const container = document.getElementById("slides-container");
|
||||
if (container) {
|
||||
container.style.display = "none";
|
||||
container.style.visibility = "hidden";
|
||||
container.style.pointerEvents = "none";
|
||||
}
|
||||
if (STATE.slideshow.slideInterval) {
|
||||
STATE.slideshow.slideInterval.stop();
|
||||
}
|
||||
SlideshowManager.stopAllPlayback();
|
||||
return;
|
||||
}
|
||||
|
||||
const activeTab = document.querySelector(".emby-tab-button-active");
|
||||
const container = document.getElementById("slides-container");
|
||||
|
||||
@@ -1604,7 +1631,9 @@ const SlideCreator = {
|
||||
fs: 0,
|
||||
iv_load_policy: 3,
|
||||
rel: 0,
|
||||
loop: 0
|
||||
loop: 0,
|
||||
playsinline: 1,
|
||||
origin: window.location.origin
|
||||
};
|
||||
|
||||
// Determine video quality
|
||||
@@ -1657,10 +1686,23 @@ const SlideCreator = {
|
||||
|
||||
// Only play if this is the active slide
|
||||
const slide = document.querySelector(`.slide[data-item-id="${itemId}"]`);
|
||||
if (slide && slide.classList.contains('active')) {
|
||||
const isVideoPlayerOpen = document.querySelector('.videoPlayerContainer') || document.querySelector('.youtubePlayerContainer');
|
||||
|
||||
if (slide && slide.classList.contains('active') && !document.hidden && (!isVideoPlayerOpen || isVideoPlayerOpen.classList.contains('hide'))) {
|
||||
event.target.playVideo();
|
||||
|
||||
// Check if it actually started playing after a short delay (handling autoplay blocks)
|
||||
setTimeout(() => {
|
||||
const timeoutId = setTimeout(() => {
|
||||
// Re-check conditions before processing fallback
|
||||
const isVideoPlayerOpenNow = document.querySelector('.videoPlayerContainer') || document.querySelector('.youtubePlayerContainer');
|
||||
if (document.hidden || (isVideoPlayerOpenNow && !isVideoPlayerOpenNow.classList.contains('hide')) || !slide.classList.contains('active')) {
|
||||
console.log(`Navigation detected during autoplay check for ${itemId}, stopping video.`);
|
||||
try {
|
||||
event.target.stopVideo();
|
||||
} catch (e) { console.warn("Error stopping video in timeout:", e); }
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.target.getPlayerState() !== YT.PlayerState.PLAYING &&
|
||||
event.target.getPlayerState() !== YT.PlayerState.BUFFERING) {
|
||||
console.warn(`Autoplay blocked for ${itemId}, attempting muted fallback`);
|
||||
@@ -1669,6 +1711,9 @@ const SlideCreator = {
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
if (!STATE.slideshow.autoplayTimeouts) STATE.slideshow.autoplayTimeouts = [];
|
||||
STATE.slideshow.autoplayTimeouts.push(timeoutId);
|
||||
|
||||
// Pause slideshow timer when video starts if configured
|
||||
if (CONFIG.waitForTrailerToEnd && STATE.slideshow.slideInterval) {
|
||||
STATE.slideshow.slideInterval.stop();
|
||||
@@ -2544,15 +2589,26 @@ const SlideshowManager = {
|
||||
* Used when navigating away from the home screen
|
||||
*/
|
||||
stopAllPlayback() {
|
||||
// 1. Pause all YouTube players
|
||||
// Clear any pending autoplay timeouts
|
||||
if (STATE.slideshow.autoplayTimeouts) {
|
||||
STATE.slideshow.autoplayTimeouts.forEach(id => clearTimeout(id));
|
||||
STATE.slideshow.autoplayTimeouts = [];
|
||||
}
|
||||
|
||||
// 1. Stop all YouTube players
|
||||
if (STATE.slideshow.videoPlayers) {
|
||||
Object.values(STATE.slideshow.videoPlayers).forEach(player => {
|
||||
try {
|
||||
if (player && typeof player.pauseVideo === 'function') {
|
||||
if (player && typeof player.stopVideo === 'function') {
|
||||
player.stopVideo();
|
||||
if (typeof player.clearVideo === 'function') {
|
||||
player.clearVideo();
|
||||
}
|
||||
} else if (player && typeof player.pauseVideo === 'function') {
|
||||
player.pauseVideo();
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn("Error pausing YouTube player:", e);
|
||||
console.warn("Error pausing/stopping YouTube player:", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2656,46 +2712,75 @@ const SlideshowManager = {
|
||||
}
|
||||
|
||||
const activeElement = document.activeElement;
|
||||
const isSlideshowFocused = container.contains(activeElement) || activeElement === container || activeElement === document.body;
|
||||
const isTvDevice = window.browser && window.browser.tv;
|
||||
const isTvLayout = window.layoutManager && window.layoutManager.tv;
|
||||
const hasTvClass = document.documentElement.classList.contains('layout-tv') || document.body.classList.contains('layout-tv');
|
||||
const isTvMode = isTvDevice || isTvLayout || hasTvClass;
|
||||
|
||||
if ((e.key === "ArrowRight" || e.key === "ArrowLeft") && !isSlideshowFocused) {
|
||||
return;
|
||||
}
|
||||
// Check Focus State
|
||||
const isBodyFocused = activeElement === document.body;
|
||||
const hasDirectFocus = container.contains(activeElement) || activeElement === container;
|
||||
|
||||
// Determine if we should handle navigation keys (Arrows, Space, M)
|
||||
// TV Mode: Strict focus required (must be on slideshow)
|
||||
// Desktop Mode: Loose focus allowed (slideshow OR body/nothing focused)
|
||||
const canControlSlideshow = isTvMode ? hasDirectFocus : (hasDirectFocus || isBodyFocused);
|
||||
|
||||
// Check for Input Fields (always ignore typing)
|
||||
const isInputElement = activeElement && (activeElement.tagName === 'INPUT' || activeElement.tagName === 'TEXTAREA' || activeElement.isContentEditable);
|
||||
if (isInputElement) return;
|
||||
|
||||
// Check active video players (ignore if video is playing/overlay is open)
|
||||
const videoPlayer = document.querySelector('.videoPlayerContainer');
|
||||
const trailerPlayer = document.querySelector('.youtubePlayerContainer');
|
||||
const isVideoOpen = (videoPlayer && !videoPlayer.classList.contains('hide')) || (trailerPlayer && !trailerPlayer.classList.contains('hide'));
|
||||
if (isVideoOpen) return;
|
||||
|
||||
switch (e.key) {
|
||||
case "ArrowRight":
|
||||
SlideshowManager.nextSlide();
|
||||
e.preventDefault();
|
||||
if (canControlSlideshow) {
|
||||
SlideshowManager.nextSlide();
|
||||
e.preventDefault();
|
||||
}
|
||||
break;
|
||||
|
||||
case "ArrowLeft":
|
||||
SlideshowManager.prevSlide();
|
||||
e.preventDefault();
|
||||
if (canControlSlideshow) {
|
||||
SlideshowManager.prevSlide();
|
||||
e.preventDefault();
|
||||
}
|
||||
break;
|
||||
|
||||
case " ": // Space bar
|
||||
this.togglePause();
|
||||
e.preventDefault();
|
||||
if (canControlSlideshow) {
|
||||
this.togglePause();
|
||||
e.preventDefault();
|
||||
}
|
||||
break;
|
||||
|
||||
case "m": // Mute toggle
|
||||
case "M":
|
||||
this.toggleMute();
|
||||
e.preventDefault();
|
||||
if (canControlSlideshow) {
|
||||
this.toggleMute();
|
||||
e.preventDefault();
|
||||
}
|
||||
break;
|
||||
|
||||
case "Enter":
|
||||
const currentItemId = STATE.slideshow.itemIds[STATE.slideshow.currentSlideIndex];
|
||||
if (currentItemId) {
|
||||
if (window.Emby && window.Emby.Page) {
|
||||
Emby.Page.show(
|
||||
`/details?id=${currentItemId}&serverId=${STATE.jellyfinData.serverId}`
|
||||
);
|
||||
} else {
|
||||
window.location.href = `#/details?id=${currentItemId}&serverId=${STATE.jellyfinData.serverId}`;
|
||||
}
|
||||
// Enter always requires direct focus on the slideshow to avoid conflicts
|
||||
if (hasDirectFocus) {
|
||||
const currentItemId = STATE.slideshow.itemIds[STATE.slideshow.currentSlideIndex];
|
||||
if (currentItemId) {
|
||||
if (window.Emby && window.Emby.Page) {
|
||||
Emby.Page.show(
|
||||
`/details?id=${currentItemId}&serverId=${STATE.jellyfinData.serverId}`
|
||||
);
|
||||
} else {
|
||||
window.location.href = `#/details?id=${currentItemId}&serverId=${STATE.jellyfinData.serverId}`;
|
||||
}
|
||||
}
|
||||
e.preventDefault();
|
||||
}
|
||||
e.preventDefault();
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -9,12 +9,20 @@
|
||||
"imageUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/raw/branch/main/logo.png",
|
||||
"versions": [
|
||||
{
|
||||
"version": "1.5.0.17",
|
||||
"changelog": "- fix: keyboard controls in TV mode\n- Add sorting options for content\n- Update mediaBarEnhanced.js and mediaBarEnhanced.css with version 4.0.1 from original repo",
|
||||
"version": "1.5.1.3",
|
||||
"changelog": "- fix: iOS/MacOS playback issue?",
|
||||
"targetAbi": "10.11.0.0",
|
||||
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.5.0.17/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
||||
"checksum": "1f65e4afb5d07843aefa832938867a4a",
|
||||
"timestamp": "2026-02-09T16:05:11Z"
|
||||
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.5.1.3/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
||||
"checksum": "9d9dbed453673d4b78acf2adaaaee126",
|
||||
"timestamp": "2026-02-10T20:12:59Z"
|
||||
},
|
||||
{
|
||||
"version": "1.5.0.28",
|
||||
"changelog": "- fix: Keyboard controls in TV mode\n- Add sorting options for content\n- Add local trailer support\n- fix performance issue\n- Update mediaBarEnhanced.js and mediaBarEnhanced.css with version 4.0.1 from upstream repo",
|
||||
"targetAbi": "10.11.0.0",
|
||||
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.5.0.28/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
||||
"checksum": "0261ff27be18d48cefa5078706954240",
|
||||
"timestamp": "2026-02-10T00:35:41Z"
|
||||
},
|
||||
{
|
||||
"version": "1.3.0.3",
|
||||
|
||||
Reference in New Issue
Block a user