I'm using youtube_player_iframe for my web app.
I wrote code below in FutureBuilder
in StatefulWidget
.
SizedBox(
height: 200,
width: MediaQuery.of(context).size.width / 3,
child: YoutubePlayerIFrame(
controller: youtubeController,
aspectRatio: 16 / 9,
),
),
This code is the cause of this question. Only when this code is wroten will the dots appear in the background. Like this pic;
When I remove above code, background is fine.
youtubeController
YoutubePlayerController youtubeController = YoutubePlayerController(
initialVideoId: "XgUOSS30OQk",
params: const YoutubePlayerParams(
showVideoAnnotations: false,
autoPlay: false,
startAt: Duration(seconds: 0),
showControls: true,
showFullscreenButton: false,
),
);
Widgets are working fine except for background glitches. No errors occurred. My memory may not be correct, but I feel that this has happened without using a third-party api before. What is the solution?
Additional
I changed index.html
to show loading circle while init, referring here. Then background is like below: