Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92fc8d72f7 | ||
|
|
cfe9dec550 | ||
|
|
1bef573aaf | ||
|
|
29a365b690 | ||
|
|
0ee0a65309 | ||
|
|
152d22b709 |
@@ -131,7 +131,7 @@
|
|||||||
<li><b>YouTube URL:</b> Play a remote trailer from YouTube.</li>
|
<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>
|
<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>
|
</ul>
|
||||||
<br><br>
|
<br>
|
||||||
You can also add a description after the ID using any separator like space, pipe
|
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>
|
(|) or dash (-): <br>e.g. <code>ID DESCRIPTION</code> or <code>ID | DESCRIPTION</code>
|
||||||
<br><br>
|
<br><br>
|
||||||
@@ -337,7 +337,7 @@
|
|||||||
<div class="inputContainer">
|
<div class="inputContainer">
|
||||||
<label class="inputLabel inputLabelUnfocused" for="PreloadCount">Preload Count</label>
|
<label class="inputLabel inputLabelUnfocused" for="PreloadCount">Preload Count</label>
|
||||||
<input is="emby-input" type="number" id="PreloadCount" name="PreloadCount" />
|
<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>
|
||||||
<div class="inputContainer">
|
<div class="inputContainer">
|
||||||
<label class="inputLabel inputLabelUnfocused" for="MaxPaginationDots">Max Pagination
|
<label class="inputLabel inputLabelUnfocused" for="MaxPaginationDots">Max Pagination
|
||||||
|
|||||||
@@ -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.0</Version>
|
<Version>1.6.1.2</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>
|
||||||
|
|
||||||
|
|||||||
@@ -997,7 +997,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.layout-tv .video-backdrop {
|
.layout-tv .video-backdrop {
|
||||||
top: -5%;
|
|
||||||
mask-image: linear-gradient(to top,
|
mask-image: linear-gradient(to top,
|
||||||
#fff0 2%,
|
#fff0 2%,
|
||||||
rgb(0 0 0 / 0.5) 6%,
|
rgb(0 0 0 / 0.5) 6%,
|
||||||
|
|||||||
@@ -1712,11 +1712,18 @@ const SlideCreator = {
|
|||||||
event.target.setPlaybackQuality(quality);
|
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 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'))) {
|
||||||
|
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();
|
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)
|
||||||
@@ -1793,7 +1800,18 @@ const SlideCreator = {
|
|||||||
|
|
||||||
STATE.slideshow.videoPlayers[itemId] = backdrop;
|
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) {
|
if (CONFIG.waitForTrailerToEnd && STATE.slideshow.slideInterval) {
|
||||||
STATE.slideshow.slideInterval.stop();
|
STATE.slideshow.slideInterval.stop();
|
||||||
}
|
}
|
||||||
@@ -2291,8 +2309,14 @@ const SlideshowManager = {
|
|||||||
Object.keys(STATE.slideshow.videoPlayers).forEach(id => {
|
Object.keys(STATE.slideshow.videoPlayers).forEach(id => {
|
||||||
if (id !== currentItemId) {
|
if (id !== currentItemId) {
|
||||||
const p = STATE.slideshow.videoPlayers[id];
|
const p = STATE.slideshow.videoPlayers[id];
|
||||||
if (p && typeof p.pauseVideo === 'function') {
|
if (p) {
|
||||||
|
try {
|
||||||
|
if (typeof p.pauseVideo === 'function') {
|
||||||
p.pauseVideo();
|
p.pauseVideo();
|
||||||
|
} else if (p.tagName === 'VIDEO') {
|
||||||
|
p.pause();
|
||||||
|
}
|
||||||
|
} catch (e) { console.warn("Error pausing player", id, e); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -2300,8 +2324,11 @@ const SlideshowManager = {
|
|||||||
|
|
||||||
// 2. Pause all other HTML5 videos e.g. local trailers
|
// 2. Pause all other HTML5 videos e.g. local trailers
|
||||||
document.querySelectorAll('video').forEach(video => {
|
document.querySelectorAll('video').forEach(video => {
|
||||||
if (!video.closest(`.slide[data-item-id="${currentItemId}"]`)) {
|
const slideParent = video.closest('.slide');
|
||||||
|
if (slideParent && slideParent.dataset.itemId !== currentItemId) {
|
||||||
|
try {
|
||||||
video.pause();
|
video.pause();
|
||||||
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -2460,17 +2487,19 @@ const SlideshowManager = {
|
|||||||
*/
|
*/
|
||||||
async preloadAdjacentSlides(currentIndex) {
|
async preloadAdjacentSlides(currentIndex) {
|
||||||
const totalItems = STATE.slideshow.totalItems;
|
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;
|
// Preload next slides
|
||||||
|
for (let i = 1; i <= preloadCount; i++) {
|
||||||
|
const nextIndex = (currentIndex + i) % totalItems;
|
||||||
const itemId = STATE.slideshow.itemIds[nextIndex];
|
const itemId = STATE.slideshow.itemIds[nextIndex];
|
||||||
|
SlideCreator.createSlideForItemId(itemId);
|
||||||
|
}
|
||||||
|
|
||||||
await SlideCreator.createSlideForItemId(itemId);
|
// Preload previous slides
|
||||||
|
for (let i = 1; i <= preloadCount; i++) {
|
||||||
if (preloadCount > 1) {
|
const prevIndex = (currentIndex - i + totalItems) % totalItems;
|
||||||
const prevIndex = (currentIndex - 1 + totalItems) % totalItems;
|
|
||||||
const prevItemId = STATE.slideshow.itemIds[prevIndex];
|
const prevItemId = STATE.slideshow.itemIds[prevIndex];
|
||||||
|
|
||||||
SlideCreator.createSlideForItemId(prevItemId);
|
SlideCreator.createSlideForItemId(prevItemId);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -2505,7 +2534,14 @@ const SlideshowManager = {
|
|||||||
const index = STATE.slideshow.itemIds.indexOf(itemId);
|
const index = STATE.slideshow.itemIds.indexOf(itemId);
|
||||||
if (index === -1) return;
|
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) {
|
if (distance > keepRange) {
|
||||||
// Destroy video player if exists
|
// Destroy video player if exists
|
||||||
if (STATE.slideshow.videoPlayers[itemId]) {
|
if (STATE.slideshow.videoPlayers[itemId]) {
|
||||||
|
|||||||
@@ -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.0",
|
"version": "1.6.1.2",
|
||||||
"changelog": "- fix tv mode issue",
|
"changelog": "- fix tv mode issue",
|
||||||
"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.0/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.6.1.2/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
||||||
"checksum": "646e58f7723dab118e767a57d62004c9",
|
"checksum": "186c08c80091c24270fda41f0908e951",
|
||||||
"timestamp": "2026-02-11T17:24:36Z"
|
"timestamp": "2026-02-11T19:13:24Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "1.6.0.2",
|
"version": "1.6.0.2",
|
||||||
|
|||||||
Reference in New Issue
Block a user