fix: auto hide player bar

This commit is contained in:
Emilien 2026-08-02 02:09:00 +02:00
parent 2b32cdb4f3
commit a794618d4e
2 changed files with 18 additions and 3 deletions

View File

@ -53,11 +53,12 @@
object-fit: contain !important; object-fit: contain !important;
} }
/* IMPORTANT: Force controls to be visible */ /* Let Shaka auto-hide the controls when idle. (Previously these were forced to
opacity:1 !important, so the control bar / progress bar never disappeared.) Keep
only the fade transition. */
.shaka-controls-button-panel, .shaka-controls-button-panel,
.shaka-scrim-container, .shaka-scrim-container,
.shaka-play-button { .shaka-play-button {
opacity: 1 !important;
transition: opacity cubic-bezier(.4, 0, .6, 1) .6s; transition: opacity cubic-bezier(.4, 0, .6, 1) .6s;
} }
@ -89,7 +90,6 @@
.shaka-seek-bar-container { .shaka-seek-bar-container {
height: 5px !important; height: 5px !important;
margin-bottom: 10px; margin-bottom: 10px;
opacity: 1 !important;
} }
.shaka-seek-bar { .shaka-seek-bar {

View File

@ -713,6 +713,21 @@ var SABRPlayer = (function () {
loadedListenerInstalled = true; loadedListenerInstalled = true;
} }
// Default to the ORIGINAL audio language (e.g. English), not a dubbed track.
// Without a preferredAudioLanguage, shaka picks the first variant (often a dub);
// it doesn't honor our `primary`/original flag on its own. Derive the original
// language from the adaptive format flagged is_original and set it as preferred.
if (!isLive && streamingData.adaptive_formats) {
var originalAudioLang = null;
for (var afi = 0; afi < streamingData.adaptive_formats.length; afi++) {
var af = streamingData.adaptive_formats[afi];
if (af.is_original && af.language) { originalAudioLang = af.language; break; }
}
if (originalAudioLang) {
try { player.configure('preferredAudioLanguage', originalAudioLang); } catch (e) {}
}
}
var startTime = options.startTime; var startTime = options.startTime;
if (startTime === undefined && options.savePlayerPos !== false) { if (startTime === undefined && options.savePlayerPos !== false) {
startTime = getPlaybackPosition(videoId); startTime = getPlaybackPosition(videoId);