Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6b769f099 | ||
|
|
77371f7b98 | ||
|
|
988b800b6d | ||
|
|
4c6514ba9f | ||
|
|
6910eba7d6 | ||
|
|
3585b47b6c | ||
|
|
8170abdc94 | ||
|
|
535c0e17bf | ||
|
|
df1cee0eeb | ||
|
|
16cc56030f | ||
|
|
13ecbac96e | ||
|
|
8bca6f9052 | ||
|
|
217db2a66d | ||
|
|
5fd7bcb8b6 | ||
|
|
0b0e41a9f9 | ||
|
|
370db55714 |
@@ -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 EnableUpstreamTrailerLayout { 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";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,6 +73,14 @@
|
|||||||
</label>
|
</label>
|
||||||
<div class="fieldDescription">Delay slide transition until trailer finishes.</div>
|
<div class="fieldDescription">Delay slide transition until trailer finishes.</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="UpstreamTrailerLayoutContainer" class="checkboxContainer checkboxContainer-withDescription">
|
||||||
|
<label>
|
||||||
|
<input is="emby-checkbox" type="checkbox" id="EnableUpstreamTrailerLayout"
|
||||||
|
name="EnableUpstreamTrailerLayout" />
|
||||||
|
<span>Enable Upstream Trailer Layout</span>
|
||||||
|
</label>
|
||||||
|
<div class="fieldDescription">Use the upstream (original) layout for trailers. This renders the video inside a container overlaying the backdrop, instead of replacing it to support full-width video.</div>
|
||||||
|
</div>
|
||||||
<div class="checkboxContainer checkboxContainer-withDescription">
|
<div class="checkboxContainer checkboxContainer-withDescription">
|
||||||
<label>
|
<label>
|
||||||
<input is="emby-checkbox" type="checkbox" id="EnableMobileVideo"
|
<input is="emby-checkbox" type="checkbox" id="EnableMobileVideo"
|
||||||
@@ -406,7 +414,7 @@
|
|||||||
'ShowTrailerButton', 'AlwaysShowArrows', 'EnableKeyboardControls',
|
'ShowTrailerButton', 'AlwaysShowArrows', 'EnableKeyboardControls',
|
||||||
'EnableCustomMediaIds', 'CustomMediaIds', 'EnableLoadingScreen',
|
'EnableCustomMediaIds', 'CustomMediaIds', 'EnableLoadingScreen',
|
||||||
'EnableSeasonalContent', 'EnableClientSideSettings', 'SortBy', 'SortOrder',
|
'EnableSeasonalContent', 'EnableClientSideSettings', 'SortBy', 'SortOrder',
|
||||||
'PreferLocalTrailers'
|
'PreferLocalTrailers', 'EnableUpstreamTrailerLayout'
|
||||||
];
|
];
|
||||||
|
|
||||||
keys.forEach(function (key) {
|
keys.forEach(function (key) {
|
||||||
@@ -443,12 +451,15 @@
|
|||||||
// Handle Prefer Local Trailers visibility
|
// Handle Prefer Local Trailers visibility
|
||||||
var enableVideoBackdropCheckbox = page.querySelector('#EnableVideoBackdrop');
|
var enableVideoBackdropCheckbox = page.querySelector('#EnableVideoBackdrop');
|
||||||
var preferLocalContainer = page.querySelector('#PreferLocalTrailersContainer');
|
var preferLocalContainer = page.querySelector('#PreferLocalTrailersContainer');
|
||||||
|
var upstreamLayoutContainer = page.querySelector('#UpstreamTrailerLayoutContainer');
|
||||||
|
|
||||||
function updatePreferLocalVisibility() {
|
function updatePreferLocalVisibility() {
|
||||||
if (enableVideoBackdropCheckbox && enableVideoBackdropCheckbox.checked) {
|
if (enableVideoBackdropCheckbox && enableVideoBackdropCheckbox.checked) {
|
||||||
if (preferLocalContainer) preferLocalContainer.style.display = 'block';
|
if (preferLocalContainer) preferLocalContainer.style.display = 'block';
|
||||||
|
if (upstreamLayoutContainer) upstreamLayoutContainer.style.display = 'block';
|
||||||
} else {
|
} else {
|
||||||
if (preferLocalContainer) preferLocalContainer.style.display = 'none';
|
if (preferLocalContainer) preferLocalContainer.style.display = 'none';
|
||||||
|
if (upstreamLayoutContainer) upstreamLayoutContainer.style.display = 'none';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -473,7 +484,7 @@
|
|||||||
'ShowTrailerButton', 'AlwaysShowArrows', 'EnableKeyboardControls',
|
'ShowTrailerButton', 'AlwaysShowArrows', 'EnableKeyboardControls',
|
||||||
'EnableCustomMediaIds', 'CustomMediaIds', 'EnableLoadingScreen',
|
'EnableCustomMediaIds', 'CustomMediaIds', 'EnableLoadingScreen',
|
||||||
'EnableSeasonalContent', 'EnableClientSideSettings', 'SortBy', 'SortOrder',
|
'EnableSeasonalContent', 'EnableClientSideSettings', 'SortBy', 'SortOrder',
|
||||||
'PreferLocalTrailers'
|
'PreferLocalTrailers', 'EnableUpstreamTrailerLayout'
|
||||||
];
|
];
|
||||||
|
|
||||||
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.5.0.7</Version>
|
<Version>1.5.0.14</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>
|
||||||
|
|
||||||
|
|||||||
@@ -343,6 +343,50 @@
|
|||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.video-container {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 100%;
|
||||||
|
width: 0;
|
||||||
|
z-index: 2;
|
||||||
|
overflow: hidden;
|
||||||
|
transition:
|
||||||
|
width 0.5s ease-in-out,
|
||||||
|
opacity 0.5s ease-in-out;
|
||||||
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
mask-image:
|
||||||
|
linear-gradient(to right, transparent 10%, black 30%),
|
||||||
|
linear-gradient(to top, transparent 2%, rgba(0, 0, 0, 0.5) 6%, black 8%);
|
||||||
|
|
||||||
|
-webkit-mask-image:
|
||||||
|
linear-gradient(to right, transparent 10%, black 30%),
|
||||||
|
linear-gradient(to top, transparent 2%, rgba(0, 0, 0, 0.5) 6%, black 8%);
|
||||||
|
|
||||||
|
mask-composite: intersect;
|
||||||
|
-webkit-mask-composite: source-in;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-container.active {
|
||||||
|
opacity: 1;
|
||||||
|
pointer-events: auto;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-player {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure video inside container fills it */
|
||||||
|
.video-container iframe,
|
||||||
|
.video-container video {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
.backdrop-container {
|
.backdrop-container {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0%;
|
top: 0%;
|
||||||
@@ -379,6 +423,10 @@
|
|||||||
object-position: center 20%;
|
object-position: center 20%;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
|
transition:
|
||||||
|
width 0.5s ease-in-out,
|
||||||
|
mask-image 0.5s ease-in-out,
|
||||||
|
-webkit-mask-image 0.5s ease-in-out;
|
||||||
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%,
|
||||||
@@ -389,6 +437,20 @@
|
|||||||
#000000 8%);
|
#000000 8%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.backdrop.with-video {
|
||||||
|
width: 100%;
|
||||||
|
mask-image:
|
||||||
|
linear-gradient(to top, #fff0 2%, rgb(0 0 0 / 0.5) 6%, #000000 8%),
|
||||||
|
linear-gradient(to right, black 30%, transparent 85%);
|
||||||
|
|
||||||
|
-webkit-mask-image:
|
||||||
|
linear-gradient(to top, #fff0 2%, rgb(0 0 0 / 0.5) 6%, #000000 8%),
|
||||||
|
linear-gradient(to right, black 30%, transparent 85%);
|
||||||
|
|
||||||
|
mask-composite: source-in;
|
||||||
|
-webkit-mask-composite: source-in;
|
||||||
|
}
|
||||||
|
|
||||||
.backdrop-overlay {
|
.backdrop-overlay {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ const CONFIG = {
|
|||||||
customMediaIds: "",
|
customMediaIds: "",
|
||||||
enableLoadingScreen: true,
|
enableLoadingScreen: true,
|
||||||
enableClientSideSettings: false,
|
enableClientSideSettings: false,
|
||||||
|
enableUpstreamTrailerLayout: false,
|
||||||
sortBy: "Random",
|
sortBy: "Random",
|
||||||
sortOrder: "Ascending",
|
sortOrder: "Ascending",
|
||||||
};
|
};
|
||||||
@@ -1537,6 +1538,7 @@ const SlideCreator = {
|
|||||||
|
|
||||||
let backdrop;
|
let backdrop;
|
||||||
let isVideo = false;
|
let isVideo = false;
|
||||||
|
let hasUpstreamVideo = false;
|
||||||
let trailerUrl = null;
|
let trailerUrl = null;
|
||||||
|
|
||||||
// 1. Check for Remote/Local Trailers
|
// 1. Check for Remote/Local Trailers
|
||||||
@@ -1584,13 +1586,31 @@ const SlideCreator = {
|
|||||||
|
|
||||||
if (isYoutube && videoId) {
|
if (isYoutube && videoId) {
|
||||||
isVideo = true;
|
isVideo = true;
|
||||||
// Create container for YouTube API
|
|
||||||
const videoClass = CONFIG.fullWidthVideo ? "video-backdrop-full" : "video-backdrop-default";
|
const videoClass = CONFIG.fullWidthVideo ? "video-backdrop-full" : "video-backdrop-default";
|
||||||
|
|
||||||
backdrop = SlideUtils.createElement("div", {
|
if (CONFIG.enableUpstreamTrailerLayout) {
|
||||||
className: `backdrop video-backdrop ${videoClass}`,
|
// UPSTREAM LAYOUT: Wrapper Container
|
||||||
id: `youtube-player-${itemId}`
|
const videoContainer = SlideUtils.createElement("div", {
|
||||||
});
|
className: "video-container",
|
||||||
|
id: `video-container-${itemId}`
|
||||||
|
});
|
||||||
|
|
||||||
|
const playerDiv = SlideUtils.createElement("div", {
|
||||||
|
id: `youtube-player-${itemId}`
|
||||||
|
});
|
||||||
|
|
||||||
|
videoContainer.appendChild(playerDiv);
|
||||||
|
slide.appendChild(videoContainer); // Append container first
|
||||||
|
|
||||||
|
isVideo = false;
|
||||||
|
hasUpstreamVideo = true;
|
||||||
|
} else {
|
||||||
|
// ENHANCED LAYOUT: Direct Backdrop Replacement
|
||||||
|
backdrop = SlideUtils.createElement("div", {
|
||||||
|
className: `backdrop video-backdrop ${videoClass}`,
|
||||||
|
id: `youtube-player-${itemId}`
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize YouTube Player
|
// Initialize YouTube Player
|
||||||
SlideUtils.loadYouTubeIframeAPI().then(() => {
|
SlideUtils.loadYouTubeIframeAPI().then(() => {
|
||||||
@@ -1676,7 +1696,19 @@ const SlideCreator = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
'onStateChange': (event) => {
|
'onStateChange': (event) => {
|
||||||
|
const slide = document.querySelector(`.slide[data-item-id="${itemId}"]`);
|
||||||
|
const videoContainer = slide ? slide.querySelector('.video-container') : null;
|
||||||
|
|
||||||
|
if (event.data === YT.PlayerState.PLAYING || event.data === YT.PlayerState.BUFFERING) {
|
||||||
|
if (videoContainer) videoContainer.classList.add('active');
|
||||||
|
} else {
|
||||||
|
if (videoContainer && event.data !== YT.PlayerState.BUFFERING) {
|
||||||
|
videoContainer.classList.remove('active');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (event.data === YT.PlayerState.ENDED) {
|
if (event.data === YT.PlayerState.ENDED) {
|
||||||
|
if (videoContainer) videoContainer.classList.remove('active');
|
||||||
if (CONFIG.waitForTrailerToEnd) {
|
if (CONFIG.waitForTrailerToEnd) {
|
||||||
SlideshowManager.nextSlide();
|
SlideshowManager.nextSlide();
|
||||||
} else {
|
} else {
|
||||||
@@ -1685,6 +1717,7 @@ const SlideCreator = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
'onError': () => {
|
'onError': () => {
|
||||||
|
if (videoContainer) videoContainer.classList.remove('active');
|
||||||
// Fallback to next slide on error
|
// Fallback to next slide on error
|
||||||
if (CONFIG.waitForTrailerToEnd) {
|
if (CONFIG.waitForTrailerToEnd) {
|
||||||
SlideshowManager.nextSlide();
|
SlideshowManager.nextSlide();
|
||||||
@@ -1705,7 +1738,7 @@ const SlideCreator = {
|
|||||||
autoplay: false,
|
autoplay: false,
|
||||||
preload: "auto",
|
preload: "auto",
|
||||||
loop: false,
|
loop: false,
|
||||||
style: "object-fit: cover; width: 100%; height: 100%; pointer-events: none;"
|
style: "object-fit: cover; object-position: center center; width: 100%; height: 100%; position: absolute; top: 0; left: 0; pointer-events: none;"
|
||||||
};
|
};
|
||||||
|
|
||||||
if (STATE.slideshow.isMuted) {
|
if (STATE.slideshow.isMuted) {
|
||||||
@@ -1737,12 +1770,34 @@ const SlideCreator = {
|
|||||||
SlideshowManager.nextSlide();
|
SlideshowManager.nextSlide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (CONFIG.enableUpstreamTrailerLayout) {
|
||||||
|
// Wrap in container
|
||||||
|
const videoContainer = SlideUtils.createElement("div", {
|
||||||
|
className: "video-container",
|
||||||
|
id: `video-container-${itemId}`
|
||||||
|
});
|
||||||
|
backdrop.style.position = "";
|
||||||
|
videoContainer.appendChild(backdrop);
|
||||||
|
slide.appendChild(videoContainer);
|
||||||
|
|
||||||
|
isVideo = false;
|
||||||
|
hasUpstreamVideo = true;
|
||||||
|
|
||||||
|
// Use requestAnimationFrame to ensure listeners attach and class adds correctly
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
backdrop.addEventListener('play', () => videoContainer.classList.add('active'));
|
||||||
|
backdrop.addEventListener('playing', () => videoContainer.classList.add('active'));
|
||||||
|
backdrop.addEventListener('pause', () => videoContainer.classList.remove('active'));
|
||||||
|
backdrop.addEventListener('ended', () => videoContainer.classList.remove('active'));
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isVideo) {
|
if (!isVideo) {
|
||||||
backdrop = SlideUtils.createElement("img", {
|
backdrop = SlideUtils.createElement("img", {
|
||||||
className: "backdrop high-quality",
|
className: hasUpstreamVideo ? "backdrop high-quality with-video" : "backdrop high-quality",
|
||||||
src: this.buildImageUrl(item, "Backdrop", 0, serverAddress, 60),
|
src: this.buildImageUrl(item, "Backdrop", 0, serverAddress, 60),
|
||||||
alt: LocalizationUtils.getLocalizedString('Backdrop', 'Backdrop'),
|
alt: LocalizationUtils.getLocalizedString('Backdrop', 'Backdrop'),
|
||||||
loading: "eager",
|
loading: "eager",
|
||||||
@@ -2655,18 +2710,6 @@ const SlideshowManager = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only trap keys if focus is on body (neutral) or inside our container.
|
|
||||||
// To allow standard TV navigation to work for other elements (e.g. library cards).
|
|
||||||
const activeEl = document.activeElement;
|
|
||||||
const isBody = activeEl === document.body || !activeEl;
|
|
||||||
const isInContainer = container.contains(activeEl) || activeEl === container;
|
|
||||||
|
|
||||||
if (!isBody && !isInContainer) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const focusElement = document.activeElement;
|
|
||||||
|
|
||||||
switch (e.key) {
|
switch (e.key) {
|
||||||
case "ArrowRight":
|
case "ArrowRight":
|
||||||
SlideshowManager.nextSlide();
|
SlideshowManager.nextSlide();
|
||||||
|
|||||||
@@ -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.5.0.7",
|
"version": "1.5.0.14",
|
||||||
"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",
|
"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",
|
||||||
"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.5.0.7/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.5.0.14/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
||||||
"checksum": "1b89e0253e62306cf01e80c97bf94ea2",
|
"checksum": "c2ed0d5ac38c3be6f904027fef0ff8eb",
|
||||||
"timestamp": "2026-02-09T12:28:44Z"
|
"timestamp": "2026-02-09T15:30:51Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "1.3.0.3",
|
"version": "1.3.0.3",
|
||||||
|
|||||||
Reference in New Issue
Block a user