File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -169,14 +169,7 @@ class ChewieState extends State<Chewie> {
169
169
).push (route);
170
170
171
171
if (kIsWeb) {
172
- final prevPosition =
173
- widget.controller.videoPlayerController.value.position;
174
- widget.controller.videoPlayerController.initialize ().then ((_) async {
175
- widget.controller._initialize ();
176
- widget.controller.videoPlayerController.seekTo (prevPosition);
177
- await widget.controller.videoPlayerController.play ();
178
- widget.controller.videoPlayerController.pause ();
179
- });
172
+ _reInitializeControllers ();
180
173
}
181
174
182
175
_isFullScreen = false ;
@@ -245,6 +238,18 @@ class ChewieState extends State<Chewie> {
245
238
}
246
239
}
247
240
}
241
+
242
+ ///When viewing full screen on web, returning from full screen causes original video to lose the picture.
243
+ ///We re initialise controllers for web only when returning from full screen
244
+ void _reInitializeControllers () {
245
+ final prevPosition = widget.controller.videoPlayerController.value.position;
246
+ widget.controller.videoPlayerController.initialize ().then ((_) async {
247
+ widget.controller._initialize ();
248
+ widget.controller.videoPlayerController.seekTo (prevPosition);
249
+ await widget.controller.videoPlayerController.play ();
250
+ widget.controller.videoPlayerController.pause ();
251
+ });
252
+ }
248
253
}
249
254
250
255
/// The ChewieController is used to configure and drive the Chewie Player
You can’t perform that action at this time.
0 commit comments