sarbagyastha / youtube_player_flutter

Flutter plugin for playing or streaming YouTube videos inline using the official iFrame Player API. Supports both Android and iOS platforms.
BSD 3-Clause "New" or "Revised" License
682 stars 754 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 3 weeks ago

adityasethipsi commented 3 weeks 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 3 weeks ago

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

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