Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29a365b690 | ||
|
|
0ee0a65309 | ||
|
|
152d22b709 | ||
|
|
216dddad94 | ||
|
|
a6de148ca1 | ||
|
|
1f9378d74d | ||
|
|
cc025779dc | ||
|
|
3d10fd59b5 | ||
|
|
bf261eba96 | ||
|
|
e3116c30cf | ||
|
|
bb39c91d32 | ||
|
|
4e0c74614a | ||
|
|
b61bf92437 | ||
|
|
dfbd6ce964 | ||
|
|
f1cbcad177 | ||
|
|
feedd5d95f | ||
|
|
87d82cca15 | ||
|
|
a70746e095 | ||
|
|
f32283e0bf | ||
|
|
8f3985f307 | ||
|
|
0b2817ecff | ||
|
|
84faee2db4 | ||
|
|
3efa07ec51 | ||
|
|
af603e8803 | ||
|
|
fe63414e4b | ||
|
|
614c86083f | ||
|
|
17b9e8921e | ||
|
|
5075226ba8 | ||
|
|
443fb1008b | ||
|
|
8f12140aad | ||
|
|
1469712bb5 | ||
|
|
76ff03ac17 | ||
|
|
25b1ba5f2b | ||
|
|
eed3ca1860 | ||
|
|
0f14577f5d |
@@ -123,9 +123,15 @@
|
|||||||
<div class="fieldDescription" id="customMediaIdsDesc">Enter the IDs of the items you want to show in the slideshow.
|
<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.
|
You can separate them by new line or comma.
|
||||||
<br><br>
|
<br><br>
|
||||||
<b>Manual Trailer Override:</b> You can specify a YouTube URL for an item by adding it in
|
<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 [https://youtu.be/...] DESCRIPTION</code>
|
brackets: <br> <code>e.g. ID DESCRIPTION [https://youtu.be/...]</code> or <code>ID [Method] DESCRIPTION</code>.
|
||||||
<br><br>
|
<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
|
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>
|
||||||
@@ -182,8 +188,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="selectContainer">
|
<div class="selectContainer">
|
||||||
<label class="selectLabel" for="PreferredVideoQuality">Preferred YouTube Quality</label>
|
<label class="selectLabel" for="PreferredVideoQuality">Preferred YouTube Quality</label>
|
||||||
<select is="emby-select" id="PreferredVideoQuality" name="PreferredVideoQuality"
|
<select is="emby-select" id="PreferredVideoQuality" name="PreferredVideoQuality" class="selectLayout emby-select-withcolor emby-select">
|
||||||
class="emby-select-withcolor emby-select">
|
|
||||||
<option value="Auto">Auto (Smart)</option>
|
<option value="Auto">Auto (Smart)</option>
|
||||||
<option value="Maximum">Maximum (4K+)</option>
|
<option value="Maximum">Maximum (4K+)</option>
|
||||||
<option value="1080p">1080p</option>
|
<option value="1080p">1080p</option>
|
||||||
@@ -285,7 +290,7 @@
|
|||||||
<h2 class="sectionTitle">Content Sorting</h2>
|
<h2 class="sectionTitle">Content Sorting</h2>
|
||||||
<div class="selectContainer">
|
<div class="selectContainer">
|
||||||
<label class="selectLabel" for="SortBy">Sort By</label>
|
<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="Random">Random</option>
|
||||||
<option value="Original">Original (Custom List Order)</option>
|
<option value="Original">Original (Custom List Order)</option>
|
||||||
<option value="PremiereDate">Premiere Date</option>
|
<option value="PremiereDate">Premiere Date</option>
|
||||||
@@ -299,7 +304,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="selectContainer">
|
<div class="selectContainer">
|
||||||
<label class="selectLabel" for="SortOrder">Sort Order</label>
|
<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="Ascending">Ascending</option>
|
||||||
<option value="Descending">Descending</option>
|
<option value="Descending">Descending</option>
|
||||||
</select>
|
</select>
|
||||||
@@ -332,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.5.0.24</Version>
|
<Version>1.6.1.1</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>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Jellyfin Slideshow by M0RPH3US v3.0.9
|
* Jellyfin Slideshow by M0RPH3US v4.0.1
|
||||||
* Modified by CodeDevMLH v1.1.0.0
|
* Modified by CodeDevMLH
|
||||||
*
|
*
|
||||||
* New features:
|
* New features:
|
||||||
* - optional Trailer background video support
|
* - optional Trailer background video support
|
||||||
@@ -14,6 +14,9 @@
|
|||||||
* - option to disable loading screen
|
* - option to disable loading screen
|
||||||
* - option to put collection (boxsets) IDs into the slideshow to display their items
|
* - 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 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);
|
@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 {
|
.homeSectionsContainer {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-top: 65vh;
|
top: 65vh;
|
||||||
z-index: 6;
|
z-index: 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -991,4 +994,15 @@
|
|||||||
|
|
||||||
.dots-container .slide-counter {
|
.dots-container .slide-counter {
|
||||||
margin: 0;
|
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%);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Jellyfin Slideshow by M0RPH3US v4.0.1
|
* Jellyfin Slideshow by M0RPH3US v4.0.1
|
||||||
* Modified by CodeDevMLH v1.1.0.0
|
* Modified by CodeDevMLH
|
||||||
*
|
*
|
||||||
* New features:
|
* New features:
|
||||||
* - optional Trailer background video support
|
* - optional Trailer background video support
|
||||||
@@ -14,6 +14,9 @@
|
|||||||
* - option to disable loading screen
|
* - option to disable loading screen
|
||||||
* - option to put collection (boxsets) IDs into the slideshow to display their items
|
* - 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 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
|
//Core Module Configuration
|
||||||
@@ -737,7 +740,11 @@ const SlideUtils = {
|
|||||||
autoplay: 1,
|
autoplay: 1,
|
||||||
controls: 1,
|
controls: 1,
|
||||||
iv_load_policy: 3,
|
iv_load_policy: 3,
|
||||||
rel: 0
|
rel: 0,
|
||||||
|
playsinline: 1,
|
||||||
|
origin: window.location.origin,
|
||||||
|
widget_referrer: window.location.href,
|
||||||
|
enablejsapi: 1
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -1333,7 +1340,7 @@ const ApiUtils = {
|
|||||||
/**
|
/**
|
||||||
* Fetches the first local trailer for an item
|
* Fetches the first local trailer for an item
|
||||||
* @param {string} itemId - Item ID
|
* @param {string} itemId - Item ID
|
||||||
* @returns {Promise<string|null>} Stream URL or null
|
* @returns {Promise<Object|null>} Trailer data object {id, url} or null
|
||||||
*/
|
*/
|
||||||
async fetchLocalTrailer(itemId) {
|
async fetchLocalTrailer(itemId) {
|
||||||
try {
|
try {
|
||||||
@@ -1353,8 +1360,11 @@ const ApiUtils = {
|
|||||||
const trailer = trailers[0];
|
const trailer = trailers[0];
|
||||||
const mediaSourceId = trailer.MediaSources && trailer.MediaSources[0] ? trailer.MediaSources[0].Id : trailer.Id;
|
const mediaSourceId = trailer.MediaSources && trailer.MediaSources[0] ? trailer.MediaSources[0].Id : trailer.Id;
|
||||||
|
|
||||||
// Construct stream URL
|
// Return object with ID and URL
|
||||||
return `${STATE.jellyfinData.serverAddress}/Videos/${trailer.Id}/stream.mp4?Static=true&mediaSourceId=${mediaSourceId}&api_key=${STATE.jellyfinData.accessToken}`;
|
return {
|
||||||
|
id: trailer.Id,
|
||||||
|
url: `${STATE.jellyfinData.serverAddress}/Videos/${trailer.Id}/stream.mp4?Static=true&mediaSourceId=${mediaSourceId}&api_key=${STATE.jellyfinData.accessToken}`
|
||||||
|
};
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -1566,8 +1576,24 @@ const SlideCreator = {
|
|||||||
|
|
||||||
// 1a. Custom URL override
|
// 1a. Custom URL override
|
||||||
if (STATE.slideshow.customTrailerUrls && STATE.slideshow.customTrailerUrls[itemId]) {
|
if (STATE.slideshow.customTrailerUrls && STATE.slideshow.customTrailerUrls[itemId]) {
|
||||||
trailerUrl = STATE.slideshow.customTrailerUrls[itemId];
|
const customValue = STATE.slideshow.customTrailerUrls[itemId];
|
||||||
console.log(`Using custom trailer URL for ${itemId}: ${trailerUrl}`);
|
|
||||||
|
// Check if the custom value is a Jellyfin Item ID (GUID)
|
||||||
|
const guidMatch = customValue.match(/^([0-9a-f]{32})$/i);
|
||||||
|
|
||||||
|
if (guidMatch) {
|
||||||
|
const videoId = guidMatch[1];
|
||||||
|
console.log(`Using custom local video ID for ${itemId}: ${videoId}`);
|
||||||
|
|
||||||
|
trailerUrl = {
|
||||||
|
id: videoId,
|
||||||
|
url: `${STATE.jellyfinData.serverAddress}/Videos/${videoId}/stream.mp4?Static=true&api_key=${STATE.jellyfinData.accessToken}`
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
// Assume it's a standard URL (YouTube, etc.)
|
||||||
|
trailerUrl = customValue;
|
||||||
|
console.log(`Using custom trailer URL for ${itemId}: ${trailerUrl}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 1b. Check Local Trailer if preferred
|
// 1b. Check Local Trailer if preferred
|
||||||
else if (CONFIG.preferLocalTrailers && item.LocalTrailerCount > 0 && item.localTrailerUrl) {
|
else if (CONFIG.preferLocalTrailers && item.LocalTrailerCount > 0 && item.localTrailerUrl) {
|
||||||
@@ -1592,12 +1618,17 @@ const SlideCreator = {
|
|||||||
let videoId = null;
|
let videoId = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const urlObj = new URL(trailerUrl);
|
let urlToCheck = trailerUrl;
|
||||||
if (urlObj.hostname.includes('youtube.com') || urlObj.hostname.includes('youtu.be')) {
|
if (typeof trailerUrl === 'object' && trailerUrl.url) {
|
||||||
|
urlToCheck = trailerUrl.url;
|
||||||
|
}
|
||||||
|
|
||||||
|
const urlObjChecked = new URL(urlToCheck);
|
||||||
|
if (urlObjChecked.hostname.includes('youtube.com') || urlObjChecked.hostname.includes('youtu.be')) {
|
||||||
isYoutube = true;
|
isYoutube = true;
|
||||||
videoId = urlObj.searchParams.get('v');
|
videoId = urlObjChecked.searchParams.get('v');
|
||||||
if (!videoId && urlObj.hostname.includes('youtu.be')) {
|
if (!videoId && urlObjChecked.hostname.includes('youtu.be')) {
|
||||||
videoId = urlObj.pathname.substring(1);
|
videoId = urlObjChecked.pathname.substring(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -1626,7 +1657,11 @@ const SlideCreator = {
|
|||||||
fs: 0,
|
fs: 0,
|
||||||
iv_load_policy: 3,
|
iv_load_policy: 3,
|
||||||
rel: 0,
|
rel: 0,
|
||||||
loop: 0
|
loop: 0,
|
||||||
|
playsinline: 1,
|
||||||
|
origin: window.location.origin,
|
||||||
|
widget_referrer: window.location.href,
|
||||||
|
enablejsapi: 1
|
||||||
};
|
};
|
||||||
|
|
||||||
// Determine video quality
|
// Determine video quality
|
||||||
@@ -1677,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)
|
||||||
@@ -1739,7 +1781,7 @@ const SlideCreator = {
|
|||||||
|
|
||||||
const videoAttributes = {
|
const videoAttributes = {
|
||||||
className: "backdrop video-backdrop",
|
className: "backdrop video-backdrop",
|
||||||
src: trailerUrl,
|
src: (typeof trailerUrl === 'object' ? trailerUrl.url : trailerUrl),
|
||||||
autoplay: false,
|
autoplay: false,
|
||||||
preload: "auto",
|
preload: "auto",
|
||||||
loop: false,
|
loop: false,
|
||||||
@@ -2030,11 +2072,20 @@ const SlideCreator = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a trailer button
|
* Creates a trailer button
|
||||||
* @param {string} url - Trailer URL
|
* @param {string|Object} trailerInfo - Trailer URL string or object {id, url}
|
||||||
* @returns {HTMLElement} Trailer button element
|
* @returns {HTMLElement} Trailer button element
|
||||||
*/
|
*/
|
||||||
createTrailerButton(url) {
|
createTrailerButton(trailerInfo) {
|
||||||
const trailerText = LocalizationUtils.getLocalizedString('Trailer', 'Trailer');
|
const trailerText = LocalizationUtils.getLocalizedString('Trailer', 'Trailer');
|
||||||
|
|
||||||
|
let url = trailerInfo;
|
||||||
|
let localTrailerId = null;
|
||||||
|
|
||||||
|
if (typeof trailerInfo === 'object' && trailerInfo !== null) {
|
||||||
|
url = trailerInfo.url;
|
||||||
|
localTrailerId = trailerInfo.id;
|
||||||
|
}
|
||||||
|
|
||||||
return SlideUtils.createElement("button", {
|
return SlideUtils.createElement("button", {
|
||||||
className: "detailButton trailer-button",
|
className: "detailButton trailer-button",
|
||||||
innerHTML: `<span class="material-icons">movie</span> <span class="trailer-text">${trailerText}</span>`,
|
innerHTML: `<span class="material-icons">movie</span> <span class="trailer-text">${trailerText}</span>`,
|
||||||
@@ -2042,7 +2093,13 @@ const SlideCreator = {
|
|||||||
onclick: (e) => {
|
onclick: (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
SlideUtils.openVideoModal(url);
|
|
||||||
|
if (localTrailerId) {
|
||||||
|
// Play local trailer using native player
|
||||||
|
ApiUtils.playItem(localTrailerId);
|
||||||
|
} else {
|
||||||
|
SlideUtils.openVideoModal(url);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -2187,6 +2244,16 @@ const SlideshowManager = {
|
|||||||
let previousVisibleSlide;
|
let previousVisibleSlide;
|
||||||
try {
|
try {
|
||||||
const container = SlideUtils.getOrCreateSlidesContainer();
|
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;
|
const totalItems = STATE.slideshow.totalItems;
|
||||||
|
|
||||||
index = Math.max(0, Math.min(index, totalItems - 1));
|
index = Math.max(0, Math.min(index, totalItems - 1));
|
||||||
@@ -2214,6 +2281,15 @@ const SlideshowManager = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
currentSlide.classList.add("active");
|
currentSlide.classList.add("active");
|
||||||
|
|
||||||
|
if (focusSelector) {
|
||||||
|
const target = currentSlide.querySelector(focusSelector);
|
||||||
|
if (target) {
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
target.focus();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Manage Video Playback: Stop others, Play current
|
// Manage Video Playback: Stop others, Play current
|
||||||
|
|
||||||
@@ -2222,8 +2298,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) {
|
||||||
p.pauseVideo();
|
try {
|
||||||
|
if (typeof p.pauseVideo === 'function') {
|
||||||
|
p.pauseVideo();
|
||||||
|
} else if (p.tagName === 'VIDEO') {
|
||||||
|
p.pause();
|
||||||
|
}
|
||||||
|
} catch (e) { console.warn("Error pausing player", id, e); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -2231,8 +2313,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');
|
||||||
video.pause();
|
if (slideParent && slideParent.dataset.itemId !== currentItemId) {
|
||||||
|
try {
|
||||||
|
video.pause();
|
||||||
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -2436,7 +2521,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]) {
|
||||||
@@ -2705,62 +2797,75 @@ const SlideshowManager = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const activeElement = document.activeElement;
|
const activeElement = document.activeElement;
|
||||||
// Check if we're in TV mode (checking class on html or body is more reliable)
|
const isTvDevice = window.browser && window.browser.tv;
|
||||||
const isTvMode = document.documentElement.classList.contains('layout-tv') || document.body.classList.contains('layout-tv') || (window.layoutManager && window.layoutManager.tv);
|
const isTvLayout = window.layoutManager && window.layoutManager.tv;
|
||||||
const isSlideshowFocused = container.contains(activeElement) || activeElement === container || (!isTvMode && activeElement === document.body);
|
const hasTvClass = document.documentElement.classList.contains('layout-tv') || document.body.classList.contains('layout-tv');
|
||||||
|
const isTvMode = isTvDevice || isTvLayout || hasTvClass;
|
||||||
const isInputElement = activeElement && (activeElement.tagName === 'INPUT' || activeElement.tagName === 'TEXTAREA' || activeElement.isContentEditable);
|
|
||||||
|
|
||||||
if (isInputElement) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if video player is open
|
// 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 videoPlayer = document.querySelector('.videoPlayerContainer');
|
||||||
const trailerPlayer = document.querySelector('.youtubePlayerContainer');
|
const trailerPlayer = document.querySelector('.youtubePlayerContainer');
|
||||||
if ((videoPlayer && !videoPlayer.classList.contains('hide')) || (trailerPlayer && !trailerPlayer.classList.contains('hide'))) {
|
const isVideoOpen = (videoPlayer && !videoPlayer.classList.contains('hide')) || (trailerPlayer && !trailerPlayer.classList.contains('hide'));
|
||||||
return;
|
if (isVideoOpen) return;
|
||||||
}
|
|
||||||
|
|
||||||
switch (e.key) {
|
switch (e.key) {
|
||||||
case "ArrowRight":
|
case "ArrowRight":
|
||||||
if (isTvMode && !isSlideshowFocused) return;
|
if (canControlSlideshow) {
|
||||||
SlideshowManager.nextSlide();
|
SlideshowManager.nextSlide();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "ArrowLeft":
|
case "ArrowLeft":
|
||||||
if (isTvMode && !isSlideshowFocused) return;
|
if (canControlSlideshow) {
|
||||||
SlideshowManager.prevSlide();
|
SlideshowManager.prevSlide();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case " ": // Space bar
|
case " ": // Space bar
|
||||||
if (isTvMode && !isSlideshowFocused) return;
|
if (canControlSlideshow) {
|
||||||
this.togglePause();
|
this.togglePause();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "m": // Mute toggle
|
case "m": // Mute toggle
|
||||||
case "M":
|
case "M":
|
||||||
if (isTvMode && !isSlideshowFocused) return;
|
if (canControlSlideshow) {
|
||||||
this.toggleMute();
|
this.toggleMute();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "Enter":
|
case "Enter":
|
||||||
if (!isSlideshowFocused) return;
|
// Enter always requires direct focus on the slideshow to avoid conflicts
|
||||||
const currentItemId = STATE.slideshow.itemIds[STATE.slideshow.currentSlideIndex];
|
if (hasDirectFocus) {
|
||||||
if (currentItemId) {
|
const currentItemId = STATE.slideshow.itemIds[STATE.slideshow.currentSlideIndex];
|
||||||
if (window.Emby && window.Emby.Page) {
|
if (currentItemId) {
|
||||||
Emby.Page.show(
|
if (window.Emby && window.Emby.Page) {
|
||||||
`/details?id=${currentItemId}&serverId=${STATE.jellyfinData.serverId}`
|
Emby.Page.show(
|
||||||
);
|
`/details?id=${currentItemId}&serverId=${STATE.jellyfinData.serverId}`
|
||||||
} else {
|
);
|
||||||
window.location.href = `#/details?id=${currentItemId}&serverId=${STATE.jellyfinData.serverId}`;
|
} else {
|
||||||
}
|
window.location.href = `#/details?id=${currentItemId}&serverId=${STATE.jellyfinData.serverId}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
e.preventDefault();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -9,12 +9,36 @@
|
|||||||
"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.24",
|
"version": "1.6.1.1",
|
||||||
"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 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.5.0.24/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.6.1.1/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
||||||
"checksum": "3a845b9a81b6305f84ea6bc7058155f8",
|
"checksum": "74483dae57374e338f933768c2c79862",
|
||||||
"timestamp": "2026-02-09T23:53:20Z"
|
"timestamp": "2026-02-11T18:57:35Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"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": "cdd0208f8cc4f4b04f50e7138e508370",
|
||||||
|
"timestamp": "2026-02-10T22:07:33Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"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.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",
|
"version": "1.3.0.3",
|
||||||
|
|||||||
Reference in New Issue
Block a user