Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92fc8d72f7 | ||
|
|
cfe9dec550 | ||
|
|
1bef573aaf | ||
|
|
29a365b690 | ||
|
|
0ee0a65309 | ||
|
|
152d22b709 | ||
|
|
216dddad94 | ||
|
|
a6de148ca1 | ||
|
|
1f9378d74d | ||
|
|
cc025779dc | ||
|
|
3d10fd59b5 |
@@ -123,9 +123,15 @@
|
||||
<div class="fieldDescription" id="customMediaIdsDesc">Enter the IDs of the items you want to show in the slideshow.
|
||||
You can separate them by new line or comma.
|
||||
<br><br>
|
||||
<b>Manual Trailer Override:</b> You can specify a YouTube URL for an item by adding it in
|
||||
brackets: <br> <code>e.g. ID DESCRIPTION [https://youtu.be/...]</code> or <code>ID [https://youtu.be/...] DESCRIPTION</code>
|
||||
<br><br>
|
||||
<b>Manual Trailer/Video Override:</b> You can specify a YouTube URL <b>OR</b> a Jellyfin Item ID (e.g. for a Theme Video) for an item by adding it in
|
||||
brackets: <br> <code>e.g. ID DESCRIPTION [https://youtu.be/...]</code> or <code>ID [Method] DESCRIPTION</code>.
|
||||
<br>
|
||||
Methods:
|
||||
<ul>
|
||||
<li><b>YouTube URL:</b> Play a remote trailer from YouTube.</li>
|
||||
<li><b>Jellyfin Item ID (GUID):</b> Play the video of another library item (e.g. a Theme Video or Backdrop Video) using the native player.</li>
|
||||
</ul>
|
||||
<br>
|
||||
You can also add a description after the ID using any separator like space, pipe
|
||||
(|) or dash (-): <br>e.g. <code>ID DESCRIPTION</code> or <code>ID | DESCRIPTION</code>
|
||||
<br><br>
|
||||
@@ -331,7 +337,7 @@
|
||||
<div class="inputContainer">
|
||||
<label class="inputLabel inputLabelUnfocused" for="PreloadCount">Preload Count</label>
|
||||
<input is="emby-input" type="number" id="PreloadCount" name="PreloadCount" />
|
||||
<div class="fieldDescription">Number of images to preload.</div>
|
||||
<div class="fieldDescription">Number of slides to preload.</div>
|
||||
</div>
|
||||
<div class="inputContainer">
|
||||
<label class="inputLabel inputLabelUnfocused" for="MaxPaginationDots">Max Pagination
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<!-- <TreatWarningsAsErrors>false</TreatWarningsAsErrors> -->
|
||||
<Title>Jellyfin Media Bar Enhanced Plugin</Title>
|
||||
<Authors>CodeDevMLH</Authors>
|
||||
<Version>1.6.0.2</Version>
|
||||
<Version>1.6.1.2</Version>
|
||||
<RepositoryUrl>https://github.com/CodeDevMLH/jellyfin-plugin-media-bar-enhanced</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -995,3 +995,14 @@
|
||||
.dots-container .slide-counter {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.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%);
|
||||
}
|
||||
|
||||
@@ -1712,11 +1712,18 @@ const SlideCreator = {
|
||||
event.target.setPlaybackQuality(quality);
|
||||
}
|
||||
|
||||
// Only play if this is the active slide
|
||||
// Only play if this is the active slide AND the slideshow is visible
|
||||
const slide = document.querySelector(`.slide[data-item-id="${itemId}"]`);
|
||||
const isVideoPlayerOpen = document.querySelector('.videoPlayerContainer') || document.querySelector('.youtubePlayerContainer');
|
||||
|
||||
if (slide && slide.classList.contains('active') && !document.hidden && (!isVideoPlayerOpen || isVideoPlayerOpen.classList.contains('hide'))) {
|
||||
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)
|
||||
@@ -1793,7 +1800,18 @@ const SlideCreator = {
|
||||
|
||||
STATE.slideshow.videoPlayers[itemId] = backdrop;
|
||||
|
||||
backdrop.addEventListener('play', () => {
|
||||
backdrop.addEventListener('play', (event) => {
|
||||
const slide = document.querySelector(`.slide[data-item-id="${itemId}"]`);
|
||||
const currentIndex = STATE.slideshow.currentSlideIndex;
|
||||
const currentItemId = STATE.slideshow.itemIds[currentIndex];
|
||||
|
||||
if (!slide || !slide.classList.contains('active') || currentItemId !== itemId) {
|
||||
console.log(`Local video ${itemId} started playing but is not active, pausing.`);
|
||||
event.target.pause();
|
||||
event.target.currentTime = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (CONFIG.waitForTrailerToEnd && STATE.slideshow.slideInterval) {
|
||||
STATE.slideshow.slideInterval.stop();
|
||||
}
|
||||
@@ -2237,6 +2255,16 @@ const SlideshowManager = {
|
||||
let previousVisibleSlide;
|
||||
try {
|
||||
const container = SlideUtils.getOrCreateSlidesContainer();
|
||||
|
||||
const activeElement = document.activeElement;
|
||||
let focusSelector = null;
|
||||
if (container.contains(activeElement)) {
|
||||
if (activeElement.classList.contains('play-button')) focusSelector = '.play-button';
|
||||
else if (activeElement.classList.contains('detail-button')) focusSelector = '.detail-button';
|
||||
else if (activeElement.classList.contains('favorite-button')) focusSelector = '.favorite-button';
|
||||
else if (activeElement.classList.contains('trailer-button')) focusSelector = '.trailer-button';
|
||||
}
|
||||
|
||||
const totalItems = STATE.slideshow.totalItems;
|
||||
|
||||
index = Math.max(0, Math.min(index, totalItems - 1));
|
||||
@@ -2265,6 +2293,15 @@ const SlideshowManager = {
|
||||
|
||||
currentSlide.classList.add("active");
|
||||
|
||||
if (focusSelector) {
|
||||
const target = currentSlide.querySelector(focusSelector);
|
||||
if (target) {
|
||||
requestAnimationFrame(() => {
|
||||
target.focus();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Manage Video Playback: Stop others, Play current
|
||||
|
||||
// 1. Pause all other YouTube players
|
||||
@@ -2272,8 +2309,14 @@ const SlideshowManager = {
|
||||
Object.keys(STATE.slideshow.videoPlayers).forEach(id => {
|
||||
if (id !== currentItemId) {
|
||||
const p = STATE.slideshow.videoPlayers[id];
|
||||
if (p && typeof p.pauseVideo === 'function') {
|
||||
p.pauseVideo();
|
||||
if (p) {
|
||||
try {
|
||||
if (typeof p.pauseVideo === 'function') {
|
||||
p.pauseVideo();
|
||||
} else if (p.tagName === 'VIDEO') {
|
||||
p.pause();
|
||||
}
|
||||
} catch (e) { console.warn("Error pausing player", id, e); }
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -2281,8 +2324,11 @@ const SlideshowManager = {
|
||||
|
||||
// 2. Pause all other HTML5 videos e.g. local trailers
|
||||
document.querySelectorAll('video').forEach(video => {
|
||||
if (!video.closest(`.slide[data-item-id="${currentItemId}"]`)) {
|
||||
video.pause();
|
||||
const slideParent = video.closest('.slide');
|
||||
if (slideParent && slideParent.dataset.itemId !== currentItemId) {
|
||||
try {
|
||||
video.pause();
|
||||
} catch (e) {}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -2441,18 +2487,20 @@ const SlideshowManager = {
|
||||
*/
|
||||
async preloadAdjacentSlides(currentIndex) {
|
||||
const totalItems = STATE.slideshow.totalItems;
|
||||
const preloadCount = CONFIG.preloadCount;
|
||||
const preloadCount = Math.min(Math.max(CONFIG.preloadCount || 1, 1), 5);
|
||||
|
||||
const nextIndex = (currentIndex + 1) % totalItems;
|
||||
const itemId = STATE.slideshow.itemIds[nextIndex];
|
||||
// Preload next slides
|
||||
for (let i = 1; i <= preloadCount; i++) {
|
||||
const nextIndex = (currentIndex + i) % totalItems;
|
||||
const itemId = STATE.slideshow.itemIds[nextIndex];
|
||||
SlideCreator.createSlideForItemId(itemId);
|
||||
}
|
||||
|
||||
await SlideCreator.createSlideForItemId(itemId);
|
||||
|
||||
if (preloadCount > 1) {
|
||||
const prevIndex = (currentIndex - 1 + totalItems) % totalItems;
|
||||
const prevItemId = STATE.slideshow.itemIds[prevIndex];
|
||||
|
||||
SlideCreator.createSlideForItemId(prevItemId);
|
||||
// Preload previous slides
|
||||
for (let i = 1; i <= preloadCount; i++) {
|
||||
const prevIndex = (currentIndex - i + totalItems) % totalItems;
|
||||
const prevItemId = STATE.slideshow.itemIds[prevIndex];
|
||||
SlideCreator.createSlideForItemId(prevItemId);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -2486,7 +2534,14 @@ const SlideshowManager = {
|
||||
const index = STATE.slideshow.itemIds.indexOf(itemId);
|
||||
if (index === -1) return;
|
||||
|
||||
const distance = Math.abs(index - currentIndex);
|
||||
const totalItems = STATE.slideshow.itemIds.length;
|
||||
|
||||
// Calculate wrapped distance
|
||||
let distance = Math.abs(index - currentIndex);
|
||||
if (totalItems > keepRange * 2) {
|
||||
distance = Math.min(distance, totalItems - distance);
|
||||
}
|
||||
|
||||
if (distance > keepRange) {
|
||||
// Destroy video player if exists
|
||||
if (STATE.slideshow.videoPlayers[itemId]) {
|
||||
|
||||
@@ -8,13 +8,21 @@
|
||||
"category": "General",
|
||||
"imageUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/raw/branch/main/logo.png",
|
||||
"versions": [
|
||||
{
|
||||
"version": "1.6.1.2",
|
||||
"changelog": "- fix tv mode issue",
|
||||
"targetAbi": "10.11.0.0",
|
||||
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.6.1.2/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
||||
"checksum": "186c08c80091c24270fda41f0908e951",
|
||||
"timestamp": "2026-02-11T19:13:24Z"
|
||||
},
|
||||
{
|
||||
"version": "1.6.0.2",
|
||||
"changelog": "- add local trailer support on trailer button\nfix: iOS/MacOS playback issue?",
|
||||
"targetAbi": "10.11.0.0",
|
||||
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.6.0.2/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
||||
"checksum": "335a682c714e3e3178f9444fc36668a0",
|
||||
"timestamp": "2026-02-10T21:44:35Z"
|
||||
"checksum": "cdd0208f8cc4f4b04f50e7138e508370",
|
||||
"timestamp": "2026-02-10T22:07:33Z"
|
||||
},
|
||||
{
|
||||
"version": "1.5.1.3",
|
||||
|
||||
Reference in New Issue
Block a user