SvenTiigi / YouTubePlayerKit

A Swift Package to easily play YouTube videos 📺
https://sventiigi.github.io/YouTubePlayerKit/
MIT License
683 stars 61 forks source link

CC bug with PiP #81

Closed Alex293 closed 7 months ago

Alex293 commented 7 months ago

What happened?

CC are not displayed and selection is not available after going in and out of PiP mode

What are the steps to reproduce?

1 configure the player inside the Example like :

private var youTubePlayer = YouTubePlayer(
        source: .url(WWDCKeynote.wwdc2023.youTubeURL),
        configuration: .init(
            automaticallyAdjustsContentInsets: true,
            allowsPictureInPictureMediaPlayback: true,
            fullscreenMode: .system,
            openURLAction: .default,
            autoPlay: false,
            captionLanguage: nil,
            showCaptions: true,
            progressBarColor: nil,
            showControls: false,
            keyboardControlsDisabled: true,
            enableJavaScriptAPI: true,
            endTime: nil,
            showFullscreenButton: true,
            language: "fr",
            showAnnotations: false,
            loopEnabled: false,
            useModestBranding: true,
            origin: nil,
            playInline: false,
            showRelatedVideos: false,
            startTime: nil,
            referrer: nil,
            customUserAgent: nil
        )
)

2 tap the inline player 3 video plays in full screen with fr CC and CC selection possible 4 tap the PiP in button 5 video plays in PiP, CC plays in inline player 6 tap the PiP out button (not the close button) 7 video plays in fullscreen without CC and CC selection

What is the expected behavior?

CC should always be visible where the video is playing and CC selection possible.

SvenTiigi commented 7 months ago

Hi @Alex293,

Sadly this seems like a YouTube Player iFrame API bug which can not be resolved by the YouTubePlayerKit as the player and the captions are controlled by the YouTube iFrame player.

Please follow the instructions on the YouTube iFrame API support page: https://developers.google.com/youtube/players/support

Alex293 commented 7 months ago

Yeah I know It's bugged on their side but I wondered if you found any workaround. Thanks for the quick replay anyway