case, they will both show. let liveVideoText = Array.from( container.querySelectorAll( "#inband-closed-caption > div > div > div" ), x => x.textContent.trim() ) .filter(String) .join("\n"); let regularVideoText = container.querySelector(".CaptionBox").innerText; updateCaptionsFunction(liveVideoText + regularVideoText); }; // immediately invoke the callback function to add subtitles to the PiP window callback([1], null); this.captionsObserver = new MutationObserver(callback); this.captionsObserver.observe(container, { attributes: false, childList: true, subtree: true, }); } } removeCaptionContainerObserver() { this.captionsObserver?.disconnect(); } getDuration() { return this.player.duration; } } this.PictureInPictureVideoWrapper = PictureInPictureVideoWrapper; PK