mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 02:48:19 -07:00
fix: update custom renderer logic/custom track spacing
This commit is contained in:
parent
348de5ac7f
commit
529e70222a
@ -1292,17 +1292,20 @@ function tryRemoveElement(elem) {
|
||||
*/
|
||||
renderSubtitlesWithCustomElement(videoElement, track, item, targetTextTrackIndex) {
|
||||
this.fetchSubtitles(track, item).then((data) => {
|
||||
if (!this.#videoSubtitlesElem) {
|
||||
if (!this.isSecondaryTrack(targetTextTrackIndex)) {
|
||||
const subtitlesContainer = document.createElement('div');
|
||||
if (!this.#videoSubtitlesElem && !this.isSecondaryTrack(targetTextTrackIndex)) {
|
||||
let subtitlesContainer = document.querySelector('.videoSubtitles');
|
||||
if (!subtitlesContainer) {
|
||||
subtitlesContainer = document.createElement('div');
|
||||
subtitlesContainer.classList.add('videoSubtitles');
|
||||
subtitlesContainer.innerHTML = '<div class="videoSubtitlesInner"></div>';
|
||||
this.#videoSubtitlesElem = subtitlesContainer.querySelector('.videoSubtitlesInner');
|
||||
this.setSubtitleAppearance(subtitlesContainer, this.#videoSubtitlesElem);
|
||||
videoElement.parentNode.appendChild(subtitlesContainer);
|
||||
this.#currentTrackEvents = data.TrackEvents;
|
||||
}
|
||||
} else if (this.isSecondaryTrack(targetTextTrackIndex)) {
|
||||
const subtitlesElement = document.createElement('div');
|
||||
subtitlesElement.classList.add('videoSubtitlesInner');
|
||||
subtitlesContainer.appendChild(subtitlesElement);
|
||||
this.#videoSubtitlesElem = subtitlesContainer.querySelector('.videoSubtitlesInner');
|
||||
this.setSubtitleAppearance(subtitlesContainer, this.#videoSubtitlesElem);
|
||||
videoElement.parentNode.appendChild(subtitlesContainer);
|
||||
this.#currentTrackEvents = data.TrackEvents;
|
||||
} else if (!this.#videoSecondarySubtitlesElem && this.isSecondaryTrack(targetTextTrackIndex)) {
|
||||
const subtitlesContainer = document.querySelector('.videoSubtitles');
|
||||
if (!subtitlesContainer) return;
|
||||
const secondarySubtitlesElement = document.createElement('div');
|
||||
|
@ -79,7 +79,8 @@ video[controls]::-webkit-media-controls {
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
margin: auto;
|
||||
display: block;
|
||||
margin-bottom: 0 !important;
|
||||
min-height: 0 !important;
|
||||
margin-bottom: 0.5em !important;
|
||||
}
|
||||
|
||||
@keyframes htmlvideoplayer-zoomin {
|
||||
|
Loading…
Reference in New Issue
Block a user