Compare commits

..

70 Commits

Author SHA1 Message Date
CodeDevMLH
29a365b690 Update manifest.json for release v1.6.1.1 [skip ci] 2026-02-11 18:57:36 +00:00
CodeDevMLH
0ee0a65309 Bump version to 1.6.1.1
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 53s
2026-02-11 19:56:42 +01:00
CodeDevMLH
152d22b709 Refine video playback logic in slideshow and update preload description 2026-02-11 19:56:20 +01:00
CodeDevMLH
216dddad94 Update manifest.json for release v1.6.1.0 [skip ci] 2026-02-11 17:24:36 +00:00
CodeDevMLH
a6de148ca1 Bump version to 1.6.1.0
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 56s
2026-02-11 18:23:42 +01:00
CodeDevMLH
1f9378d74d Enhance video backdrop styling for TV layout and improve focus management in slideshow 2026-02-11 18:22:44 +01:00
CodeDevMLH
cc025779dc Update manifest.json for release v1.6.0.2 [skip ci] 2026-02-10 22:07:34 +00:00
CodeDevMLH
3d10fd59b5 Enhance manual trailer/video override instructions to support Jellyfin Item IDs and clarify usage
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 54s
2026-02-10 23:06:40 +01:00
CodeDevMLH
bf261eba96 Update manifest.json for release v1.6.0.2 [skip ci] 2026-02-10 21:44:36 +00:00
CodeDevMLH
e3116c30cf Bump version to 1.6.0.2
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 50s
2026-02-10 22:43:47 +01:00
CodeDevMLH
bb39c91d32 Enhance custom trailer URL handling to support Jellyfin Item IDs and standard URLs 2026-02-10 22:43:40 +01:00
CodeDevMLH
4e0c74614a Update manifest.json for release v1.6.0.1 [skip ci] 2026-02-10 21:27:25 +00:00
CodeDevMLH
b61bf92437 Bump version to 1.6.0.1 in project files and manifest
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 53s
2026-02-10 22:26:32 +01:00
CodeDevMLH
dfbd6ce964 Enable autoplay for video playback in SlideUtils 2026-02-10 22:26:28 +01:00
CodeDevMLH
f1cbcad177 Update manifest.json for release v1.6.0.0 [skip ci] 2026-02-10 21:18:26 +00:00
CodeDevMLH
feedd5d95f Bump version to 1.6.0.0
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 50s
2026-02-10 22:17:36 +01:00
CodeDevMLH
87d82cca15 Enhance trailer handling: support object format for trailer URLs and add widget referrer for YouTube embeds 2026-02-10 22:17:24 +01:00
CodeDevMLH
a70746e095 Update manifest.json for release v1.5.1.3 [skip ci] 2026-02-10 20:12:59 +00:00
CodeDevMLH
f32283e0bf Bump version to 1.5.1.3 and update changelog for release
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 54s
2026-02-10 21:12:05 +01:00
CodeDevMLH
8f3985f307 Update manifest.json for release v1.5.1.2 [skip ci] 2026-02-10 17:39:23 +00:00
CodeDevMLH
0b2817ecff Bump version to 1.5.1.2 and update changelog for release
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 52s
2026-02-10 18:38:31 +01:00
CodeDevMLH
84faee2db4 Update manifest.json for release v1.5.1.1 [skip ci] 2026-02-10 16:58:48 +00:00
CodeDevMLH
3efa07ec51 Bump version to 1.5.1.1 and update changelog for release
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 55s
2026-02-10 17:57:54 +01:00
CodeDevMLH
af603e8803 Enhance options in mediaBarEnhanced for seasonal content, local trailers, and sorting criteria [skip ci] 2026-02-10 01:57:51 +01:00
CodeDevMLH
fe63414e4b Update manifest.json for release v1.5.1.0 [skip ci] 2026-02-10 00:51:17 +00:00
CodeDevMLH
614c86083f Bump version to 1.5.1.0 and update changelog for iOS/MacOS playback fix
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 51s
2026-02-10 01:50:27 +01:00
CodeDevMLH
17b9e8921e Update manifest.json for release v1.5.0.28 [skip ci] 2026-02-10 00:35:42 +00:00
CodeDevMLH
5075226ba8 fix wording
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 56s
2026-02-10 01:34:47 +01:00
CodeDevMLH
443fb1008b Update version to 1.5.0.28 and enhance changelog with new features and fixes [skip ci] 2026-02-10 01:32:33 +01:00
CodeDevMLH
8f12140aad Update manifest.json for release v1.5.0.28 [skip ci] 2026-02-10 00:22:00 +00:00
CodeDevMLH
1469712bb5 reverted to 25
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 54s
2026-02-10 01:21:08 +01:00
CodeDevMLH
76ff03ac17 Update manifest.json for release v1.5.0.27 [skip ci] 2026-02-10 00:16:23 +00:00
CodeDevMLH
25b1ba5f2b Bump version to 1.5.0.26 and update changelog for recent changes
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 50s
2026-02-10 01:15:33 +01:00
CodeDevMLH
eed3ca1860 Update manifest.json for release v1.5.0.25 [skip ci] 2026-02-10 00:07:06 +00:00
CodeDevMLH
0f14577f5d Bump version to 1.5.0.25 and update changelog for recent changes
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 51s
2026-02-10 01:06:15 +01:00
CodeDevMLH
9999d6a633 Update manifest.json for release v1.5.0.24 [skip ci] 2026-02-09 23:53:21 +00:00
CodeDevMLH
a935fd7d5d Bump version to 1.5.0.24 and update changelog for recent changes
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 52s
2026-02-10 00:52:29 +01:00
CodeDevMLH
60293e81e1 Update manifest.json for release v1.5.0.23 [skip ci] 2026-02-09 23:34:11 +00:00
CodeDevMLH
f54e55fe04 Bump version to 1.5.0.23 and update changelog for recent changes
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 52s
2026-02-10 00:33:19 +01:00
CodeDevMLH
b3c42e2100 Update manifest.json for release v1.5.0.22 [skip ci] 2026-02-09 23:08:41 +00:00
CodeDevMLH
20ddbb32c7 Bump version to 1.5.0.22 and update changelog for recent changes
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 50s
2026-02-10 00:07:51 +01:00
CodeDevMLH
14a5075e22 Update manifest.json for release v1.5.0.21 [skip ci] 2026-02-09 22:29:09 +00:00
CodeDevMLH
accb316a81 Bump version to 1.5.0.21 and update changelog for recent changes
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 55s
2026-02-09 23:28:15 +01:00
CodeDevMLH
51c5cdf5bf Update manifest.json for release v1.5.0.20 [skip ci] 2026-02-09 16:53:01 +00:00
CodeDevMLH
306eff757b Update changelog formatting for version 1.5.0.20
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 51s
2026-02-09 17:52:10 +01:00
CodeDevMLH
b8f28a5735 Bump version to 1.5.0.20 and update changelog for recent changes
Some checks failed
Auto Release Plugin / build-and-release (push) Has been cancelled
2026-02-09 17:49:36 +01:00
CodeDevMLH
0932d9611d Update manifest.json for release v1.5.0.19 [skip ci] 2026-02-09 16:33:56 +00:00
CodeDevMLH
5e616db0ae Bump version to 1.5.0.19 and update changelog for recent changes
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 57s
2026-02-09 17:32:59 +01:00
CodeDevMLH
538b0f2110 Update manifest.json for release v1.5.0.18 [skip ci] 2026-02-09 16:21:43 +00:00
CodeDevMLH
e717c07c54 Bump version to 1.5.0.18 and update changelog for recent changes
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 1m2s
2026-02-09 17:20:40 +01:00
CodeDevMLH
0fa2d01ca3 Update manifest.json for release v1.5.0.17 [skip ci] 2026-02-09 16:05:12 +00:00
CodeDevMLH
5299b2a9d5 Bump version to 1.5.0.17 and update changelog for recent changes
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 57s
2026-02-09 17:04:15 +01:00
CodeDevMLH
4f244988b9 Update manifest.json for release v1.5.0.16 [skip ci] 2026-02-09 15:54:25 +00:00
CodeDevMLH
5635a8f05e Bump version to 1.5.0.16 and update changelog for keyboard controls and sorting options
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 52s
2026-02-09 16:53:33 +01:00
CodeDevMLH
c901da4b0c Update manifest.json for release v1.5.0.15 [skip ci] 2026-02-09 15:41:45 +00:00
CodeDevMLH
c45cd0281f Bump version to 1.5.0.15 in project file and manifest.json
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 51s
2026-02-09 16:40:24 +01:00
CodeDevMLH
0c3e74829a Remove upstream trailer layout feature from configuration and UI 2026-02-09 16:40:01 +01:00
CodeDevMLH
e6b769f099 Update manifest.json for release v1.5.0.14 [skip ci] 2026-02-09 15:30:53 +00:00
CodeDevMLH
77371f7b98 Bump version to 1.5.0.14 and update changelog in manifest.json
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 58s
2026-02-09 16:29:56 +01:00
CodeDevMLH
988b800b6d Update manifest.json for release v1.5.0.13 [skip ci] 2026-02-09 15:21:45 +00:00
CodeDevMLH
4c6514ba9f Bump version to 1.5.0.13 and update changelog in manifest.json
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 52s
2026-02-09 16:20:52 +01:00
CodeDevMLH
6910eba7d6 Update manifest.json for release v1.5.0.12 [skip ci] 2026-02-09 15:10:07 +00:00
CodeDevMLH
3585b47b6c Bump version to 1.5.0.12 and update changelog in manifest.json
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 56s
2026-02-09 16:09:10 +01:00
CodeDevMLH
8170abdc94 Update manifest.json for release v1.5.0.11 [skip ci] 2026-02-09 14:56:05 +00:00
CodeDevMLH
535c0e17bf Add upstream trailer layout feature and update version to 1.5.0.11
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 52s
2026-02-09 15:55:14 +01:00
CodeDevMLH
df1cee0eeb Update manifest.json for release v1.5.0.10 [skip ci] 2026-02-09 13:31:00 +00:00
CodeDevMLH
16cc56030f Bump version to 1.5.0.10 in project file and manifest
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 55s
2026-02-09 14:30:05 +01:00
CodeDevMLH
13ecbac96e Update manifest.json for release v1.5.0.9 [skip ci] 2026-02-09 13:18:30 +00:00
CodeDevMLH
8bca6f9052 Bump version to 1.5.0.9 in project file and manifest
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 54s
2026-02-09 14:17:38 +01:00
CodeDevMLH
217db2a66d Fix video backdrop styling for full coverage and pointer events 2026-02-09 14:17:22 +01:00
5 changed files with 281 additions and 73 deletions

View File

@@ -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

View File

@@ -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.8</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>

View File

@@ -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);
@@ -992,3 +995,14 @@
.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%);
}

View File

@@ -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
@@ -85,6 +88,7 @@ const STATE = {
isMuted: CONFIG.startMuted, isMuted: CONFIG.startMuted,
customTrailerUrls: {}, customTrailerUrls: {},
ytPromise: null, ytPromise: null,
autoplayTimeouts: [],
}, },
}; };
@@ -605,7 +609,10 @@ const SlideUtils = {
getOrCreateSlidesContainer() { getOrCreateSlidesContainer() {
let container = document.getElementById("slides-container"); let container = document.getElementById("slides-container");
if (!container) { if (!container) {
container = this.createElement("div", { id: "slides-container" }); container = this.createElement("div", {
id: "slides-container",
className: "noautofocus"
});
document.body.appendChild(container); document.body.appendChild(container);
} }
return container; return container;
@@ -733,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
} }
}); });
}); });
@@ -1329,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 {
@@ -1349,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) {
@@ -1413,6 +1427,24 @@ class SlideTimer {
*/ */
const VisibilityObserver = { const VisibilityObserver = {
updateVisibility() { 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 activeTab = document.querySelector(".emby-tab-button-active");
const container = document.getElementById("slides-container"); const container = document.getElementById("slides-container");
@@ -1544,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) {
@@ -1570,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) {
@@ -1604,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
@@ -1655,12 +1712,32 @@ 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}"]`);
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'))) {
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)
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 && if (event.target.getPlayerState() !== YT.PlayerState.PLAYING &&
event.target.getPlayerState() !== YT.PlayerState.BUFFERING) { event.target.getPlayerState() !== YT.PlayerState.BUFFERING) {
console.warn(`Autoplay blocked for ${itemId}, attempting muted fallback`); console.warn(`Autoplay blocked for ${itemId}, attempting muted fallback`);
@@ -1669,6 +1746,9 @@ const SlideCreator = {
} }
}, 1000); }, 1000);
if (!STATE.slideshow.autoplayTimeouts) STATE.slideshow.autoplayTimeouts = [];
STATE.slideshow.autoplayTimeouts.push(timeoutId);
// Pause slideshow timer when video starts if configured // Pause slideshow timer when video starts if configured
if (CONFIG.waitForTrailerToEnd && STATE.slideshow.slideInterval) { if (CONFIG.waitForTrailerToEnd && STATE.slideshow.slideInterval) {
STATE.slideshow.slideInterval.stop(); STATE.slideshow.slideInterval.stop();
@@ -1701,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,
@@ -1992,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>`,
@@ -2004,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);
}
}, },
}); });
}, },
@@ -2149,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));
@@ -2177,6 +2282,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
// 1. Pause all other YouTube players // 1. Pause all other YouTube players
@@ -2184,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); }
} }
} }
}); });
@@ -2193,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) {}
} }
}); });
@@ -2398,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]) {
@@ -2544,15 +2674,26 @@ const SlideshowManager = {
* Used when navigating away from the home screen * Used when navigating away from the home screen
*/ */
stopAllPlayback() { 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) { if (STATE.slideshow.videoPlayers) {
Object.values(STATE.slideshow.videoPlayers).forEach(player => { Object.values(STATE.slideshow.videoPlayers).forEach(player => {
try { 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(); player.pauseVideo();
} }
} catch (e) { } catch (e) {
console.warn("Error pausing YouTube player:", e); console.warn("Error pausing/stopping YouTube player:", e);
} }
}); });
} }
@@ -2655,52 +2796,76 @@ const SlideshowManager = {
return; return;
} }
// Only trap keys if focus is on body (neutral) or inside our container. const activeElement = document.activeElement;
// To allow standard TV navigation to work for other elements (e.g. library cards). const isTvDevice = window.browser && window.browser.tv;
const activeEl = document.activeElement; const isTvLayout = window.layoutManager && window.layoutManager.tv;
const isBody = activeEl === document.body || !activeEl; const hasTvClass = document.documentElement.classList.contains('layout-tv') || document.body.classList.contains('layout-tv');
const isInContainer = container.contains(activeEl) || activeEl === container; const isTvMode = isTvDevice || isTvLayout || hasTvClass;
if (!isBody && !isInContainer) { // Check Focus State
return; const isBodyFocused = activeElement === document.body;
} const hasDirectFocus = container.contains(activeElement) || activeElement === container;
const focusElement = document.activeElement; // 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) { switch (e.key) {
case "ArrowRight": case "ArrowRight":
SlideshowManager.nextSlide(); if (canControlSlideshow) {
e.preventDefault(); SlideshowManager.nextSlide();
e.preventDefault();
}
break; break;
case "ArrowLeft": case "ArrowLeft":
SlideshowManager.prevSlide(); if (canControlSlideshow) {
e.preventDefault(); SlideshowManager.prevSlide();
e.preventDefault();
}
break; break;
case " ": // Space bar case " ": // Space bar
this.togglePause(); if (canControlSlideshow) {
e.preventDefault(); this.togglePause();
e.preventDefault();
}
break; break;
case "m": // Mute toggle case "m": // Mute toggle
case "M": case "M":
this.toggleMute(); if (canControlSlideshow) {
e.preventDefault(); this.toggleMute();
e.preventDefault();
}
break; break;
case "Enter": case "Enter":
const currentItemId = STATE.slideshow.itemIds[STATE.slideshow.currentSlideIndex]; // Enter always requires direct focus on the slideshow to avoid conflicts
if (currentItemId) { if (hasDirectFocus) {
if (window.Emby && window.Emby.Page) { const currentItemId = STATE.slideshow.itemIds[STATE.slideshow.currentSlideIndex];
Emby.Page.show( if (currentItemId) {
`/details?id=${currentItemId}&serverId=${STATE.jellyfinData.serverId}` if (window.Emby && window.Emby.Page) {
); Emby.Page.show(
} else { `/details?id=${currentItemId}&serverId=${STATE.jellyfinData.serverId}`
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;
} }
}); });

View File

@@ -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.8", "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.8/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": "f0541cd85271cda5ce9fb786b69e8376", "checksum": "74483dae57374e338f933768c2c79862",
"timestamp": "2026-02-09T13:11:29Z" "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",