Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8676160e7b | ||
|
|
c562560bc0 | ||
|
|
98474d4ff6 | ||
|
|
14c0eb43ed | ||
|
|
c4cbeda2b8 | ||
|
|
53ad568be4 |
@@ -12,7 +12,7 @@
|
||||
<!-- <TreatWarningsAsErrors>false</TreatWarningsAsErrors> -->
|
||||
<Title>Jellyfin Media Bar Enhanced Plugin</Title>
|
||||
<Authors>CodeDevMLH</Authors>
|
||||
<Version>1.7.0.8</Version>
|
||||
<Version>1.7.0.10</Version>
|
||||
<RepositoryUrl>https://github.com/CodeDevMLH/jellyfin-plugin-media-bar-enhanced</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -742,17 +742,20 @@ 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',
|
||||
style: 'width: 100%; height: 100%; border: none;',
|
||||
});
|
||||
ytIframe.setAttribute('referrerpolicy', 'strict-origin-when-cross-origin');
|
||||
|
||||
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,
|
||||
host: 'https://www.youtube-nocookie.com',
|
||||
new YT.Player(ytIframe, {
|
||||
playerVars: {
|
||||
autoplay: 1,
|
||||
controls: 1,
|
||||
@@ -761,14 +764,6 @@ const SlideUtils = {
|
||||
playsinline: 1,
|
||||
origin: window.location.origin,
|
||||
enablejsapi: 1
|
||||
},
|
||||
events: {
|
||||
'onReady': (event) => {
|
||||
const iframe = event.target.getIframe();
|
||||
if (iframe) {
|
||||
iframe.setAttribute('referrerpolicy', 'strict-origin-when-cross-origin');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -1735,7 +1730,8 @@ const SlideCreator = {
|
||||
}
|
||||
|
||||
const isLowPower = isLowPowerDevice();
|
||||
const isActiveSlide = index === STATE.slideshow.currentSlideIndex;
|
||||
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) {
|
||||
@@ -1749,12 +1745,16 @@ 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",
|
||||
referrerpolicy: "strict-origin-when-cross-origin"
|
||||
});
|
||||
|
||||
videoBackdrop.appendChild(ytPlayerDiv);
|
||||
videoBackdrop.appendChild(ytPlayerIframe);
|
||||
|
||||
// Initialize YouTube Player
|
||||
SlideUtils.loadYouTubeIframeAPI().then(() => {
|
||||
@@ -1799,19 +1799,10 @@ 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,
|
||||
host: 'https://www.youtube-nocookie.com',
|
||||
STATE.slideshow.videoPlayers[itemId] = new YT.Player(ytPlayerIframe, {
|
||||
playerVars: playerVars,
|
||||
events: {
|
||||
'onReady': (event) => {
|
||||
const iframe = event.target.getIframe();
|
||||
if (iframe) {
|
||||
iframe.setAttribute('referrerpolicy', 'strict-origin-when-cross-origin');
|
||||
}
|
||||
|
||||
// Store start/end time and videoId for later use
|
||||
event.target._startTime = playerVars.start || 0;
|
||||
event.target._endTime = playerVars.end || undefined;
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
"imageUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/raw/branch/main/logo.png",
|
||||
"versions": [
|
||||
{
|
||||
"version": "1.7.0.8",
|
||||
"version": "1.7.0.10",
|
||||
"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.8/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
||||
"checksum": "05f8ed4ff193c559c3ae56a5b7aeef68",
|
||||
"timestamp": "2026-03-06T01:17:18Z"
|
||||
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.7.0.10/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
||||
"checksum": "054793363c988cfd1dce37876a0e800f",
|
||||
"timestamp": "2026-03-06T02:02:52Z"
|
||||
},
|
||||
{
|
||||
"version": "1.6.6.4",
|
||||
|
||||
Reference in New Issue
Block a user