sarbagyastha / youtube_player_flutter

A Flutter plugin for inline playback or streaming of YouTube videos using the official iFrame Player API.
https://youtube.sarbagyastha.com.np
BSD 3-Clause "New" or "Revised" License
713 stars 831 forks source link

On IOS and Android, subtitles of videos are being cutoff when playing the YouTube video in full screen mode. #957

Open adityasethipsi opened 5 months ago

adityasethipsi commented 5 months ago

On IOS and Android, subtitles of videos are being cutoff when playing the YouTube video in full screen mode. On IOS and Android, subtitles of videos are being cutoff when playing the YouTube video in full screen mode.

To Reproduce Include any video URL which has subtitles and play the video in full screen mode in Android or IOS

`Widget _mobileYoutubePlayerWidget() { if (_videoID == null || !widget.shouldShowVideoPlayer) { return _scaffold(null); } return YoutubePlayerBuilder( player: _youtubePlayer() as YoutubePlayer, builder: (context, player) { return _scaffold(player); }, onExitFullScreen: () { // Full screen video is hiding top & bottom status bar. So below code is to // show the top/bottom status bar back on exit based on system configured values SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: SystemUiOverlay.values); }, ); // return YoutubePlayer( // controller: _controllerYoutube!, // showVideoProgressIndicator: true, // progressIndicatorColor: Colors.lightBlue, // ); }

/// this is for youtube player Widget _youtubePlayer() { return _controllerYoutube != null ? YoutubePlayer( // key: Key(_videoID), controller: _controllerYoutube!, showVideoProgressIndicator: true, progressIndicatorColor: Colors.lightBlue, ) : const SizedBox(); }

void initPlayer() {

if (_videoID != null) { _controllerYoutube = YoutubePlayerController( initialVideoId: _videoID!, flags: const YoutubePlayerFlags( mute: false, autoPlay: false, disableDragSeek: false, loop: false, isLive: false, forceHD: false, enableCaption: true, ), ); } if (_controllerYoutube != null) { _controllerYoutube!.addListener(playStateChangedCallback); } }`

Expected behavior Subtitles should not cut off and display correctly,

Screenshots IMG_4209

Technical Details:

Additional context Same behavior on android as well

adityasethipsi commented 5 months ago

Some videos are having subtitle on youtube web app but not showing on flutter app. @sarbagyastha

https://www.youtube.com/watch?v=nPt8bK2gbaU