Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64dbc3cfd3 | ||
|
|
c998266dd7 | ||
|
|
9b941e5a77 | ||
|
|
1d70d7166d | ||
|
|
5331f0faf1 | ||
|
|
0508188705 | ||
|
|
cc861f4263 | ||
|
|
10e6cdc4a2 | ||
|
|
a8c7faab6b | ||
|
|
6df390fa18 | ||
|
|
d0c3d7ee4d | ||
|
|
bc621aacdf |
@@ -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.7.0.2</Version>
|
<Version>1.7.0.6</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>
|
||||||
|
|
||||||
|
|||||||
@@ -1403,7 +1403,9 @@ const ApiUtils = {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
id: trailer.Id,
|
id: trailer.Id,
|
||||||
url: `${STATE.jellyfinData.serverAddress}/Videos/${trailer.Id}/stream.mp4?mediaSourceId=${mediaSourceId}&api_key=${STATE.jellyfinData.accessToken}`
|
// static=true forces Jellyfin to direct-stream (no transcoding) which enables
|
||||||
|
// HTTP Range Requests (Accept-Ranges: bytes) — required by Safari for video playback
|
||||||
|
url: `${STATE.jellyfinData.serverAddress}/Videos/${trailer.Id}/stream.mp4?mediaSourceId=${mediaSourceId}&api_key=${STATE.jellyfinData.accessToken}&static=true`
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -1734,153 +1736,275 @@ const SlideCreator = {
|
|||||||
// Create a wrapper for opacity transition
|
// Create a wrapper for opacity transition
|
||||||
videoBackdrop = SlideUtils.createElement("div", {
|
videoBackdrop = SlideUtils.createElement("div", {
|
||||||
className: `backdrop video-backdrop ${videoClass}`,
|
className: `backdrop video-backdrop ${videoClass}`,
|
||||||
style: "opacity: 0; transition: opacity 1.2s ease-in-out;" // Start interrupted/transparent
|
style: "opacity: 0; transition: opacity 1.2s ease-in-out;"
|
||||||
});
|
});
|
||||||
|
|
||||||
const ytPlayerDiv = SlideUtils.createElement("div", {
|
// Detect Safari/WebKit — the YouTube IFrame API causes Error 153 on WebKit
|
||||||
id: `youtube-player-${itemId}`,
|
// due to cross-origin postMessage restrictions. Use a plain iframe embed instead.
|
||||||
style: "width: 100%; height: 100%;"
|
const isSafariWebKit = /Safari/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent) && !/Chromium/.test(navigator.userAgent);
|
||||||
});
|
|
||||||
|
|
||||||
videoBackdrop.appendChild(ytPlayerDiv);
|
if (isSafariWebKit) {
|
||||||
|
// ── Safari: plain iframe embed ───────────────────────────────────────────
|
||||||
// Initialize YouTube Player
|
// Fetch SponsorBlock data and apply as URL params (start= / end=)
|
||||||
SlideUtils.loadYouTubeIframeAPI().then(() => {
|
|
||||||
// Fetch SponsorBlock data
|
|
||||||
ApiUtils.fetchSponsorBlockData(videoId).then(segments => {
|
ApiUtils.fetchSponsorBlockData(videoId).then(segments => {
|
||||||
const playerVars = {
|
let startParam = '';
|
||||||
autoplay: 1,
|
let endParam = '';
|
||||||
mute: 1, // need to be muted for Safari, because apple makes life difficult...
|
|
||||||
controls: 0,
|
|
||||||
disablekb: 1,
|
|
||||||
fs: 0,
|
|
||||||
iv_load_policy: 3,
|
|
||||||
rel: 0,
|
|
||||||
loop: 0,
|
|
||||||
playsinline: 1,
|
|
||||||
origin: window.location.origin,
|
|
||||||
enablejsapi: 1
|
|
||||||
};
|
|
||||||
|
|
||||||
// Determine video quality
|
|
||||||
let quality = 'hd1080';
|
|
||||||
if (CONFIG.preferredVideoQuality === 'Maximum') {
|
|
||||||
quality = 'highres';
|
|
||||||
} else if (CONFIG.preferredVideoQuality === '720p') {
|
|
||||||
quality = 'hd720';
|
|
||||||
} else if (CONFIG.preferredVideoQuality === '1080p') {
|
|
||||||
quality = 'hd1080';
|
|
||||||
} else { // Auto or fallback
|
|
||||||
// If screen is wider than 1920, prefer highres, otherwise 1080p
|
|
||||||
quality = window.screen.width > 1920 ? 'highres' : 'hd1080';
|
|
||||||
}
|
|
||||||
|
|
||||||
playerVars.suggestedQuality = quality;
|
|
||||||
|
|
||||||
// Apply SponsorBlock start/end times
|
|
||||||
if (segments.intro) {
|
if (segments.intro) {
|
||||||
playerVars.start = Math.ceil(segments.intro[1]);
|
startParam = `&start=${Math.ceil(segments.intro[1])}`;
|
||||||
console.info(`SponsorBlock intro detected for video ${videoId}: skipping to ${playerVars.start}s`);
|
console.info(`SponsorBlock (Safari) intro skip: starting at ${Math.ceil(segments.intro[1])}s`);
|
||||||
}
|
}
|
||||||
if (segments.outro) {
|
if (segments.outro) {
|
||||||
playerVars.end = Math.floor(segments.outro[0]);
|
endParam = `&end=${Math.floor(segments.outro[0])}`;
|
||||||
console.info(`SponsorBlock outro detected for video ${videoId}: ending at ${playerVars.end}s`);
|
console.info(`SponsorBlock (Safari) outro skip: ending at ${Math.floor(segments.outro[0])}s`);
|
||||||
}
|
}
|
||||||
|
|
||||||
STATE.slideshow.videoPlayers[itemId] = new YT.Player(`youtube-player-${itemId}`, {
|
// enablejsapi=1 needed for postMessage commands — does NOT trigger IFrame API handshake
|
||||||
height: '100%',
|
const embedUrl = `https://www.youtube-nocookie.com/embed/${videoId}?autoplay=1&mute=1&controls=0&playsinline=1&rel=0&iv_load_policy=3&enablejsapi=1&origin=${encodeURIComponent(window.location.origin)}${startParam}${endParam}`;
|
||||||
width: '100%',
|
|
||||||
videoId: videoId,
|
|
||||||
host: 'https://www.youtube-nocookie.com',
|
|
||||||
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
|
const ytIframe = document.createElement('iframe');
|
||||||
event.target._startTime = playerVars.start || 0;
|
ytIframe.style.cssText = 'width:100%;height:100%;border:0;pointer-events:none;';
|
||||||
event.target._endTime = playerVars.end || undefined;
|
ytIframe.setAttribute('allow', 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share');
|
||||||
event.target._videoId = videoId;
|
ytIframe.setAttribute('allowfullscreen', '');
|
||||||
|
ytIframe.setAttribute('referrerpolicy', 'strict-origin-when-cross-origin');
|
||||||
|
ytIframe.src = embedUrl;
|
||||||
|
videoBackdrop.appendChild(ytIframe);
|
||||||
|
|
||||||
// Store reference to wrapper for fading
|
// Show immediately — no onStateChange available for plain iframes
|
||||||
event.target._wrapperDiv = videoBackdrop;
|
videoBackdrop.style.opacity = '1';
|
||||||
|
|
||||||
// Unmute now if user wants sound.
|
// Helper: send postMessage command to the iframe player
|
||||||
if (!STATE.slideshow.isMuted) {
|
const ytCmd = (func, args = []) => {
|
||||||
event.target.unMute();
|
try {
|
||||||
event.target.setVolume(40);
|
ytIframe.contentWindow?.postMessage(
|
||||||
}
|
JSON.stringify({ event: 'command', func, args }),
|
||||||
|
'https://www.youtube-nocookie.com'
|
||||||
|
);
|
||||||
|
} catch(e) { /* cross-origin access may fail on some iOS versions */ }
|
||||||
|
};
|
||||||
|
|
||||||
if (typeof event.target.setPlaybackQuality === 'function') {
|
// YouTube won't send onStateChange events unless we explicitly subscribe.
|
||||||
event.target.setPlaybackQuality(quality);
|
// The IFrame API does this automatically; we must do it manually for plain iframes.
|
||||||
}
|
const subscribeToYtEvents = () => {
|
||||||
|
try {
|
||||||
|
// Step 1: Announce we're listening
|
||||||
|
ytIframe.contentWindow?.postMessage(
|
||||||
|
JSON.stringify({ event: 'listening' }),
|
||||||
|
'https://www.youtube-nocookie.com'
|
||||||
|
);
|
||||||
|
// Step 2: Subscribe to state change events
|
||||||
|
ytIframe.contentWindow?.postMessage(
|
||||||
|
JSON.stringify({ event: 'command', func: 'addEventListener', args: ['onStateChange'] }),
|
||||||
|
'https://www.youtube-nocookie.com'
|
||||||
|
);
|
||||||
|
} catch(e) {}
|
||||||
|
};
|
||||||
|
|
||||||
// Stop playback if slide was navigated away from
|
// Subscribe when iframe has finished loading
|
||||||
const slide = document.querySelector(`.slide[data-item-id="${itemId}"]`);
|
ytIframe.addEventListener('load', subscribeToYtEvents);
|
||||||
const isVideoPlayerOpen = document.querySelector('.videoPlayerContainer') || document.querySelector('.youtubePlayerContainer');
|
|
||||||
|
|
||||||
if (!slide || !slide.classList.contains('active') || document.hidden || (isVideoPlayerOpen && !isVideoPlayerOpen.classList.contains('hide'))) {
|
// Listen for YouTube state changes (video ended → advance slide)
|
||||||
event.target.stopVideo();
|
const handleYtMessage = (event) => {
|
||||||
} else {
|
if (!event.origin.includes('youtube')) return;
|
||||||
// Pause slideshow timer when video starts if configured
|
try {
|
||||||
if (CONFIG.waitForTrailerToEnd && STATE.slideshow.slideInterval) {
|
const data = typeof event.data === 'string' ? JSON.parse(event.data) : event.data;
|
||||||
STATE.slideshow.slideInterval.stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Safety check after 1s: handle navigation-away during the window,
|
// Player is ready — re-subscribe in case the first attempt was too early
|
||||||
// and fallback to muted play if autoplay failed for any reason.
|
if (data.event === 'onReady') {
|
||||||
const timeoutId = setTimeout(() => {
|
subscribeToYtEvents();
|
||||||
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:", e); }
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If somehow not playing/buffering yet, force muted fallback
|
if (data.event === 'onStateChange') {
|
||||||
const state = event.target.getPlayerState();
|
console.log(`🍎 Safari YT state: ${data.info} for ${itemId}`);
|
||||||
if (state !== YT.PlayerState.PLAYING && state !== YT.PlayerState.BUFFERING) {
|
if (data.info === 0) { // 0 = ENDED
|
||||||
console.warn(`Autoplay stalled for ${itemId}, attempting muted fallback`);
|
|
||||||
event.target.mute();
|
|
||||||
event.target.playVideo();
|
|
||||||
}
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
if (!STATE.slideshow.autoplayTimeouts) STATE.slideshow.autoplayTimeouts = [];
|
|
||||||
STATE.slideshow.autoplayTimeouts.push(timeoutId);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'onStateChange': (event) => {
|
|
||||||
// Fade in when playing
|
|
||||||
if (event.data === YT.PlayerState.PLAYING) {
|
|
||||||
if (event.target._wrapperDiv) {
|
|
||||||
event.target._wrapperDiv.style.opacity = "1";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.data === YT.PlayerState.ENDED) {
|
|
||||||
const slide = document.querySelector(`.slide[data-item-id="${itemId}"]`);
|
const slide = document.querySelector(`.slide[data-item-id="${itemId}"]`);
|
||||||
if (slide && slide.classList.contains('active')) {
|
if (slide && slide.classList.contains('active')) {
|
||||||
SlideshowManager.nextSlide();
|
SlideshowManager.nextSlide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
'onError': (event) => {
|
} catch(e) {}
|
||||||
console.warn(`YouTube player error ${event.data} for video ${videoId}`);
|
};
|
||||||
// Fallback to next slide on error
|
window.addEventListener('message', handleYtMessage);
|
||||||
if (CONFIG.waitForTrailerToEnd) {
|
|
||||||
SlideshowManager.nextSlide();
|
// Create a postMessage-based stub compatible with all slide management code
|
||||||
|
// Key: we NEVER clear ytIframe.src — that would break the YouTube session and cause Error 153.
|
||||||
|
// Instead we use postMessage pause/play/seek to control playback state.
|
||||||
|
STATE.slideshow.videoPlayers[itemId] = {
|
||||||
|
_isSafariIframe: true,
|
||||||
|
_iframe: ytIframe,
|
||||||
|
_videoId: videoId,
|
||||||
|
_embedUrl: embedUrl,
|
||||||
|
_msgHandler: handleYtMessage,
|
||||||
|
pauseVideo() { ytCmd('pauseVideo'); },
|
||||||
|
stopVideo() { ytCmd('pauseVideo'); ytCmd('seekTo', [0, true]); },
|
||||||
|
playVideo() { ytCmd('playVideo'); },
|
||||||
|
mute() { ytCmd('mute'); },
|
||||||
|
unMute() { ytCmd('unMute'); },
|
||||||
|
setVolume(v) { ytCmd('setVolume', [v]); },
|
||||||
|
getIframe() { return ytIframe; },
|
||||||
|
getPlayerState() { return 1; }, // approximate: avoids triggering fallback timeouts
|
||||||
|
loadVideoById({ videoId: vid, startSeconds = 0 }) {
|
||||||
|
if (vid === this._videoId) {
|
||||||
|
// Same video — seek to start and resume. NEVER change src (would cause Error 153).
|
||||||
|
ytCmd('seekTo', [startSeconds, true]);
|
||||||
|
ytCmd('playVideo');
|
||||||
|
} else {
|
||||||
|
// Different video — need a fresh embed URL
|
||||||
|
const url = `https://www.youtube-nocookie.com/embed/${vid}?autoplay=1&mute=1&controls=0&playsinline=1&rel=0&iv_load_policy=3&enablejsapi=1&origin=${encodeURIComponent(window.location.origin)}`;
|
||||||
|
ytIframe.src = url;
|
||||||
|
this._videoId = vid;
|
||||||
|
this._embedUrl = url;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
destroy() {
|
||||||
|
window.removeEventListener('message', this._msgHandler);
|
||||||
|
ytIframe.remove();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log(`🍎 Safari detected — using plain iframe embed for YouTube video ${videoId}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// ── Non-Safari: YouTube IFrame API ──────────────────────────────────────
|
||||||
|
const ytPlayerDiv = SlideUtils.createElement("div", {
|
||||||
|
id: `youtube-player-${itemId}`,
|
||||||
|
style: "width: 100%; height: 100%;"
|
||||||
|
});
|
||||||
|
|
||||||
|
videoBackdrop.appendChild(ytPlayerDiv);
|
||||||
|
|
||||||
|
SlideUtils.loadYouTubeIframeAPI().then(() => {
|
||||||
|
ApiUtils.fetchSponsorBlockData(videoId).then(segments => {
|
||||||
|
const playerVars = {
|
||||||
|
autoplay: 1,
|
||||||
|
mute: 1, // need to be muted for Safari, because apple makes life difficult...
|
||||||
|
controls: 0,
|
||||||
|
disablekb: 1,
|
||||||
|
fs: 0,
|
||||||
|
iv_load_policy: 3,
|
||||||
|
rel: 0,
|
||||||
|
loop: 0,
|
||||||
|
playsinline: 1,
|
||||||
|
origin: window.location.origin,
|
||||||
|
enablejsapi: 1
|
||||||
|
};
|
||||||
|
|
||||||
|
// Determine video quality
|
||||||
|
let quality = 'hd1080';
|
||||||
|
if (CONFIG.preferredVideoQuality === 'Maximum') {
|
||||||
|
quality = 'highres';
|
||||||
|
} else if (CONFIG.preferredVideoQuality === '720p') {
|
||||||
|
quality = 'hd720';
|
||||||
|
} else if (CONFIG.preferredVideoQuality === '1080p') {
|
||||||
|
quality = 'hd1080';
|
||||||
|
} else {
|
||||||
|
quality = window.screen.width > 1920 ? 'highres' : 'hd1080';
|
||||||
|
}
|
||||||
|
|
||||||
|
playerVars.suggestedQuality = quality;
|
||||||
|
|
||||||
|
// Apply SponsorBlock start/end times
|
||||||
|
if (segments.intro) {
|
||||||
|
playerVars.start = Math.ceil(segments.intro[1]);
|
||||||
|
console.info(`SponsorBlock intro detected for video ${videoId}: skipping to ${playerVars.start}s`);
|
||||||
|
}
|
||||||
|
if (segments.outro) {
|
||||||
|
playerVars.end = Math.floor(segments.outro[0]);
|
||||||
|
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',
|
||||||
|
playerVars: playerVars,
|
||||||
|
events: {
|
||||||
|
'onReady': (event) => {
|
||||||
|
const iframe = event.target.getIframe();
|
||||||
|
if (iframe) {
|
||||||
|
iframe.setAttribute('referrerpolicy', 'strict-origin-when-cross-origin');
|
||||||
|
// Full allow attribute matching what YouTube sets on their own embed pages
|
||||||
|
iframe.setAttribute('allow', 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Store start/end time and videoId for later use
|
||||||
|
event.target._startTime = playerVars.start || 0;
|
||||||
|
event.target._endTime = playerVars.end || undefined;
|
||||||
|
event.target._videoId = videoId;
|
||||||
|
|
||||||
|
// Store reference to wrapper for fading
|
||||||
|
event.target._wrapperDiv = videoBackdrop;
|
||||||
|
|
||||||
|
// Unmute now if user wants sound.
|
||||||
|
if (!STATE.slideshow.isMuted) {
|
||||||
|
event.target.unMute();
|
||||||
|
event.target.setVolume(40);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof event.target.setPlaybackQuality === 'function') {
|
||||||
|
event.target.setPlaybackQuality(quality);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Stop playback if slide was navigated away from
|
||||||
|
const slide = document.querySelector(`.slide[data-item-id="${itemId}"]`);
|
||||||
|
const isVideoPlayerOpen = document.querySelector('.videoPlayerContainer') || document.querySelector('.youtubePlayerContainer');
|
||||||
|
|
||||||
|
if (!slide || !slide.classList.contains('active') || document.hidden || (isVideoPlayerOpen && !isVideoPlayerOpen.classList.contains('hide'))) {
|
||||||
|
event.target.stopVideo();
|
||||||
|
} else {
|
||||||
|
if (CONFIG.waitForTrailerToEnd && STATE.slideshow.slideInterval) {
|
||||||
|
STATE.slideshow.slideInterval.stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
const timeoutId = setTimeout(() => {
|
||||||
|
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:", e); }
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const state = event.target.getPlayerState();
|
||||||
|
if (state !== YT.PlayerState.PLAYING && state !== YT.PlayerState.BUFFERING) {
|
||||||
|
console.warn(`Autoplay stalled for ${itemId}, attempting muted fallback`);
|
||||||
|
event.target.mute();
|
||||||
|
event.target.playVideo();
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
if (!STATE.slideshow.autoplayTimeouts) STATE.slideshow.autoplayTimeouts = [];
|
||||||
|
STATE.slideshow.autoplayTimeouts.push(timeoutId);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'onStateChange': (event) => {
|
||||||
|
if (event.data === YT.PlayerState.PLAYING) {
|
||||||
|
if (event.target._wrapperDiv) {
|
||||||
|
event.target._wrapperDiv.style.opacity = "1";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.data === YT.PlayerState.ENDED) {
|
||||||
|
const slide = document.querySelector(`.slide[data-item-id="${itemId}"]`);
|
||||||
|
if (slide && slide.classList.contains('active')) {
|
||||||
|
SlideshowManager.nextSlide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'onError': (event) => {
|
||||||
|
console.warn(`YouTube player error ${event.data} for video ${videoId}`);
|
||||||
|
if (CONFIG.waitForTrailerToEnd) {
|
||||||
|
SlideshowManager.nextSlide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
} // end non-Safari
|
||||||
|
|
||||||
// 2. Check for local video trailers in MediaSources if yt is not available
|
// 2. Check for local video trailers in MediaSources if yt is not available
|
||||||
} else if (!isYoutube) {
|
} else if (!isYoutube) {
|
||||||
@@ -1928,7 +2052,10 @@ const SlideCreator = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
videoBackdrop.addEventListener('error', (event) => {
|
videoBackdrop.addEventListener('error', (event) => {
|
||||||
console.warn(`Local video error for item ${itemId}`);
|
const src = event.target.src || event.target.getAttribute('data-src') || 'unknown';
|
||||||
|
const errCode = event.target.error ? event.target.error.code : 'n/a';
|
||||||
|
const errMsg = event.target.error ? event.target.error.message : 'n/a';
|
||||||
|
console.warn(`Local video error for item ${itemId} | code=${errCode} | msg=${errMsg} | url=${src}`);
|
||||||
const slide = event.target.closest('.slide');
|
const slide = event.target.closest('.slide');
|
||||||
if (slide && slide.classList.contains('active')) {
|
if (slide && slide.classList.contains('active')) {
|
||||||
SlideshowManager.nextSlide();
|
SlideshowManager.nextSlide();
|
||||||
@@ -2522,9 +2649,10 @@ const SlideshowManager = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if playback successfully started, otherwise fallback to muted
|
// Check if playback successfully started, otherwise fallback to muted
|
||||||
|
// (Only for real YT.Player instances — Safari stub's getPlayerState() always returns 1)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (!currentSlide.classList.contains('active')) return;
|
if (!currentSlide.classList.contains('active')) return;
|
||||||
if (player.getPlayerState &&
|
if (player.getPlayerState && typeof YT !== 'undefined' &&
|
||||||
player.getPlayerState() !== YT.PlayerState.PLAYING &&
|
player.getPlayerState() !== YT.PlayerState.PLAYING &&
|
||||||
player.getPlayerState() !== YT.PlayerState.BUFFERING) {
|
player.getPlayerState() !== YT.PlayerState.BUFFERING) {
|
||||||
console.log("YouTube loadVideoById didn't start playback, retrying muted...");
|
console.log("YouTube loadVideoById didn't start playback, retrying muted...");
|
||||||
|
|||||||
@@ -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.7.0.2",
|
"version": "1.7.0.6",
|
||||||
"changelog": "- Add YouTube no-cookie host and referrer policy for iframe security to fix playback issues on iOS/MacOS",
|
"changelog": "- Add YouTube no-cookie host and referrer policy for iframe security to fix playback issues on iOS/MacOS",
|
||||||
"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.7.0.2/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.7.0.6/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
||||||
"checksum": "ac29b647173ef306beb01f3f66373c21",
|
"checksum": "58cb845a803a209362acbc01acc7dacc",
|
||||||
"timestamp": "2026-03-05T22:44:55Z"
|
"timestamp": "2026-03-06T00:25:03Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "1.6.6.4",
|
"version": "1.6.6.4",
|
||||||
|
|||||||
Reference in New Issue
Block a user