Compare commits
37 Commits
1a0050ae1a
...
v1.7.0.11
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de62c794f9 | ||
|
|
fc2491a4ef | ||
|
|
03276d7722 | ||
|
|
8676160e7b | ||
|
|
c562560bc0 | ||
|
|
98474d4ff6 | ||
|
|
14c0eb43ed | ||
|
|
c4cbeda2b8 | ||
|
|
53ad568be4 | ||
|
|
fba64bd0f6 | ||
|
|
3da16c4c5c | ||
|
|
c7cd7be3ee | ||
|
|
6d90523eef | ||
|
|
2a3e8057a1 | ||
|
|
42026b0ee8 | ||
|
|
64dbc3cfd3 | ||
|
|
c998266dd7 | ||
|
|
9b941e5a77 | ||
|
|
1d70d7166d | ||
|
|
5331f0faf1 | ||
|
|
0508188705 | ||
|
|
cc861f4263 | ||
|
|
10e6cdc4a2 | ||
|
|
a8c7faab6b | ||
|
|
6df390fa18 | ||
|
|
d0c3d7ee4d | ||
|
|
bc621aacdf | ||
|
|
73eb30d671 | ||
|
|
2cfbec95c9 | ||
|
|
08fc29cba3 | ||
|
|
0d6b835486 | ||
|
|
bf620e447f | ||
|
|
3117d627dd | ||
|
|
71402f7e86 | ||
|
|
cce202b88d | ||
|
|
1d334e4d95 | ||
|
|
142063ce63 |
@@ -241,7 +241,7 @@
|
||||
<span>Start Muted</span>
|
||||
</label>
|
||||
<div class="fieldDescription">Start trailer video playback muted. (Known issue: In the
|
||||
Android/IOS app, backdrop trailers are always muted.)</div>
|
||||
Android/IOS app, backdrop trailers are always muted.)<br><b style="color:#ffcc00">Warning:</b> Disabling this may cause autoplay to fail on certain browsers due to strict autoplay policies.</div>
|
||||
</div>
|
||||
<div class="checkboxContainer checkboxContainer-withDescription">
|
||||
<label>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<!-- <TreatWarningsAsErrors>false</TreatWarningsAsErrors> -->
|
||||
<Title>Jellyfin Media Bar Enhanced Plugin</Title>
|
||||
<Authors>CodeDevMLH</Authors>
|
||||
<Version>1.6.6.4</Version>
|
||||
<Version>1.7.0.11</Version>
|
||||
<RepositoryUrl>https://github.com/CodeDevMLH/jellyfin-plugin-media-bar-enhanced</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -163,6 +163,14 @@ const isUserLoggedIn = () => {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Detects if the current device is a low-power device (Smart TVs, etc.)
|
||||
* @returns {boolean} True if running on a low-power device
|
||||
*/
|
||||
const isLowPowerDevice = () => {
|
||||
return /webOS|LG Browser|SMART-TV|SmartTV|Tizen|Viera|NetCast|Roku|VIDAA/i.test(navigator.userAgent);
|
||||
};
|
||||
|
||||
/**
|
||||
* Initializes Jellyfin data from ApiClient
|
||||
* @param {Function} callback - Function to call once data is initialized
|
||||
@@ -734,16 +742,21 @@ const SlideUtils = {
|
||||
}
|
||||
|
||||
if (isYoutube && videoId) {
|
||||
const playerDiv = this.createElement('div', { id: 'modal-yt-player' });
|
||||
contentContainer.appendChild(playerDiv);
|
||||
const ytIframe = this.createElement('iframe', {
|
||||
id: 'modal-yt-player',
|
||||
src: `https://www.youtube-nocookie.com/embed/${videoId}?enablejsapi=1&origin=${encodeURIComponent(window.location.origin)}`,
|
||||
allow: 'autoplay; encrypted-media; fullscreen; picture-in-picture',
|
||||
style: 'width: 100%; height: 100%; border: none;',
|
||||
referrerpolicy: 'strict-origin-when-cross-origin',
|
||||
allowfullscreen: 'true'
|
||||
});
|
||||
|
||||
contentContainer.appendChild(ytIframe);
|
||||
overlay.append(closeButton, contentContainer);
|
||||
document.body.appendChild(overlay);
|
||||
|
||||
this.loadYouTubeIframeAPI().then(() => {
|
||||
new YT.Player('modal-yt-player', {
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
videoId: videoId,
|
||||
new YT.Player(ytIframe, {
|
||||
playerVars: {
|
||||
autoplay: 1,
|
||||
controls: 1,
|
||||
@@ -751,7 +764,6 @@ const SlideUtils = {
|
||||
rel: 0,
|
||||
playsinline: 1,
|
||||
origin: window.location.origin,
|
||||
widget_referrer: window.location.href,
|
||||
enablejsapi: 1
|
||||
}
|
||||
});
|
||||
@@ -1395,7 +1407,7 @@ const ApiUtils = {
|
||||
|
||||
return {
|
||||
id: trailer.Id,
|
||||
url: `${STATE.jellyfinData.serverAddress}/Videos/${trailer.Id}/stream.mp4?mediaSourceId=${mediaSourceId}&api_key=${STATE.jellyfinData.accessToken}`
|
||||
url: `${STATE.jellyfinData.serverAddress}/Videos/${trailer.Id}/stream.mp4?mediaSourceId=${mediaSourceId}&api_key=${STATE.jellyfinData.accessToken}&static=true`
|
||||
};
|
||||
}
|
||||
return null;
|
||||
@@ -1434,7 +1446,7 @@ const ApiUtils = {
|
||||
|
||||
return {
|
||||
id: video.Id,
|
||||
url: `${STATE.jellyfinData.serverAddress}/Videos/${video.Id}/stream.mp4?api_key=${STATE.jellyfinData.accessToken}`
|
||||
url: `${STATE.jellyfinData.serverAddress}/Videos/${video.Id}/stream.mp4?api_key=${STATE.jellyfinData.accessToken}&static=true`
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1660,7 +1672,7 @@ const SlideCreator = {
|
||||
|
||||
trailerUrl = {
|
||||
id: videoId,
|
||||
url: `${STATE.jellyfinData.serverAddress}/Videos/${videoId}/stream.mp4?api_key=${STATE.jellyfinData.accessToken}`
|
||||
url: `${STATE.jellyfinData.serverAddress}/Videos/${videoId}/stream.mp4?api_key=${STATE.jellyfinData.accessToken}&static=true`
|
||||
};
|
||||
} else {
|
||||
// Assume it's a standard URL (YouTube, etc.)
|
||||
@@ -1688,7 +1700,7 @@ const SlideCreator = {
|
||||
console.log(`Using local trailer fallback for ${itemId}: ${trailerUrl}`);
|
||||
}
|
||||
|
||||
const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
||||
const isMobile = /Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
||||
|
||||
// Client Setting Overrides
|
||||
const enableVideo = MediaBarEnhancedSettingsManager.getSetting('videoBackdrops', CONFIG.enableVideoBackdrop);
|
||||
@@ -1718,7 +1730,12 @@ const SlideCreator = {
|
||||
console.warn("Invalid trailer URL:", trailerUrl);
|
||||
}
|
||||
|
||||
if (isYoutube && videoId) {
|
||||
const isLowPower = isLowPowerDevice();
|
||||
const itemIndex = STATE.slideshow.itemIds ? STATE.slideshow.itemIds.indexOf(itemId) : -1;
|
||||
const isActiveSlide = itemIndex !== -1 && itemIndex === STATE.slideshow.currentSlideIndex;
|
||||
const shouldCreateVideo = !isLowPower || isActiveSlide;
|
||||
|
||||
if (isYoutube && videoId && shouldCreateVideo) {
|
||||
isVideo = true;
|
||||
// Create container for YouTube API
|
||||
const videoClass = CONFIG.fullWidthVideo ? "video-backdrop-full" : "video-backdrop-default";
|
||||
@@ -1729,12 +1746,17 @@ const SlideCreator = {
|
||||
style: "opacity: 0; transition: opacity 1.2s ease-in-out;" // Start interrupted/transparent
|
||||
});
|
||||
|
||||
const ytPlayerDiv = SlideUtils.createElement("div", {
|
||||
// Create an iframe upfront
|
||||
const ytPlayerIframe = SlideUtils.createElement("iframe", {
|
||||
id: `youtube-player-${itemId}`,
|
||||
style: "width: 100%; height: 100%;"
|
||||
src: `https://www.youtube-nocookie.com/embed/${videoId}?enablejsapi=1&origin=${encodeURIComponent(window.location.origin)}`,
|
||||
style: "width: 100%; height: 100%; border: none;",
|
||||
allow: "autoplay; encrypted-media; fullscreen; picture-in-picture",
|
||||
referrerpolicy: "strict-origin-when-cross-origin",
|
||||
allowfullscreen: "true"
|
||||
});
|
||||
|
||||
videoBackdrop.appendChild(ytPlayerDiv);
|
||||
videoBackdrop.appendChild(ytPlayerIframe);
|
||||
|
||||
// Initialize YouTube Player
|
||||
SlideUtils.loadYouTubeIframeAPI().then(() => {
|
||||
@@ -1751,7 +1773,6 @@ const SlideCreator = {
|
||||
loop: 0,
|
||||
playsinline: 1,
|
||||
origin: window.location.origin,
|
||||
widget_referrer: window.location.href,
|
||||
enablejsapi: 1
|
||||
};
|
||||
|
||||
@@ -1780,10 +1801,7 @@ const SlideCreator = {
|
||||
console.info(`SponsorBlock outro detected for video ${videoId}: ending at ${playerVars.end}s`);
|
||||
}
|
||||
|
||||
STATE.slideshow.videoPlayers[itemId] = new YT.Player(`youtube-player-${itemId}`, {
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
videoId: videoId,
|
||||
STATE.slideshow.videoPlayers[itemId] = new YT.Player(ytPlayerIframe, {
|
||||
playerVars: playerVars,
|
||||
events: {
|
||||
'onReady': (event) => {
|
||||
@@ -1870,7 +1888,7 @@ const SlideCreator = {
|
||||
});
|
||||
|
||||
// 2. Check for local video trailers in MediaSources if yt is not available
|
||||
} else if (!isYoutube) {
|
||||
} else if (!isYoutube && shouldCreateVideo) {
|
||||
isVideo = true;
|
||||
|
||||
const videoSrc = (typeof trailerUrl === 'object' ? trailerUrl.url : trailerUrl);
|
||||
@@ -2562,7 +2580,7 @@ const SlideshowManager = {
|
||||
STATE.slideshow.isTransitioning = false;
|
||||
|
||||
if (previousVisibleSlide) {
|
||||
const enableAnimations = MediaBarEnhancedSettingsManager.getSetting('slideAnimations', CONFIG.slideAnimationEnabled);
|
||||
const enableAnimations = MediaBarEnhancedSettingsManager.getSetting('slideAnimations', CONFIG.slideAnimationEnabled) && !isLowPowerDevice();
|
||||
if (enableAnimations) {
|
||||
const prevBackdrop = previousVisibleSlide.querySelector(".backdrop");
|
||||
const prevLogo = previousVisibleSlide.querySelector(".logo");
|
||||
@@ -2603,7 +2621,9 @@ const SlideshowManager = {
|
||||
*/
|
||||
async preloadAdjacentSlides(currentIndex) {
|
||||
const totalItems = STATE.slideshow.totalItems;
|
||||
const preloadCount = Math.min(Math.max(CONFIG.preloadCount || 1, 1), 5);
|
||||
let preloadCount = Math.min(Math.max(CONFIG.preloadCount || 1, 1), 5);
|
||||
if (isLowPowerDevice()) preloadCount = 1; // Strict limit for TVs
|
||||
|
||||
const preloadedIds = new Set();
|
||||
|
||||
// Preload next slides
|
||||
|
||||
@@ -8,6 +8,14 @@
|
||||
"category": "General",
|
||||
"imageUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/raw/branch/main/logo.png",
|
||||
"versions": [
|
||||
{
|
||||
"version": "1.7.0.11",
|
||||
"changelog": "- Add YouTube no-cookie host and referrer policy for iframe security to fix playback issues on iOS/MacOS",
|
||||
"targetAbi": "10.11.0.0",
|
||||
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.7.0.11/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
||||
"checksum": "8c2aba88a7abe379657604b3114da089",
|
||||
"timestamp": "2026-03-06T02:19:18Z"
|
||||
},
|
||||
{
|
||||
"version": "1.6.6.4",
|
||||
"changelog": "- feat: add static backdrop also for video backdrops\n- fix: renaming issue of settings (avoiding conflict with other plugins)",
|
||||
|
||||
Reference in New Issue
Block a user