Youtube_player_flutter: [BUG] Player not working in full screen on web

Created on 23 Jun 2021  Â·  7Comments  Â·  Source: sarbagyastha/youtube_player_flutter

Describe the bug
When player's full screen button is clicked on web, it tries to open up the full screen but then goes back to the normal view and resets the video to its initial position.

To Reproduce
Steps to reproduce the behavior: Run the youtube_player_iframe example on web and click on the full screen button in the player. (NOTE: the hosted example is working fine, but when a new version is built it is having this issue. So, I believe some new changes have introduced this issue.)

Technical Details:

  • OS: Windows 10
  • Browser: Chrome
  • Library Version used: 2.1.0
bug

Most helpful comment

Flutter 2.3.0-24.1.pre • channel beta , This version is what i am using right now and the issue seems to be fixed regarding the fullscreen.

All 7 comments

I am also facing this issue, Any Solutions or workaround as of now ?

I am also facing the same issue. Will it be fixed anytime soon? Is there a workaround?

I think it was fixed in the latest flutter upgrade today, but when we resize the browser window, it is getting weird ui, the console window is showing the error below :

Height of Platform View type: [youtube-player-1063275035] may not be set. Defaulting to height: 100%.
Set style.height to any appropriate value to stop this message.
Width of Platform View type: [youtube-player-1063275035] may not be set. Defaulting to width: 100%.
Set style.width to any appropriate value to stop this message.

I think it was fixed in the latest flutter upgrade today, but when we resize the browser window, it is getting weird ui, the console window is showing the error below :

Height of Platform View type: [youtube-player-1063275035] may not be set. Defaulting to height: 100%.
Set style.height to any appropriate value to stop this message.
Width of Platform View type: [youtube-player-1063275035] may not be set. Defaulting to width: 100%.
Set style.width to any appropriate value to stop this message.

It is not working form me still. The Flutter version is 2.2.2.

Widget build(BuildContext context) {
double width = MediaQuery.of(context).size.width;

return Container(
  alignment: Alignment.center,
  width: width,
  child: Row(
    crossAxisAlignment: CrossAxisAlignment.start,
    children: [
      Expanded(
        child: YoutubePlayerIFrame(
          controller: _controller,
          aspectRatio: 16 / 9,
        ),
      ),
    ],
  ),
);

}

_controller = YoutubePlayerController(
initialVideoId: videoId,
params: YoutubePlayerParams(
autoPlay: false,
strictRelatedVideos: true,
startAt: startDuration,
showFullscreenButton: true,
desktopMode: true,
privacyEnhanced: true,
//useHybridComposition: true,
),
);

This is the code. Fullscreen button doesn't work

Flutter 2.3.0-24.1.pre • channel beta , This version is what i am using right now and the issue seems to be fixed regarding the fullscreen.

Flutter 2.3.0-24.1.pre • channel beta , This version is what i am using right now and the issue seems to be fixed regarding the fullscreen.

Thank you!!!
this solution works!!!

Was this page helpful?
0 / 5 - 0 ratings