@@ -106,6 +106,13 @@ class _FakeClosedCaptionFile extends ClosedCaptionFile {
106106}
107107
108108void main () {
109+ late FakeVideoPlayerPlatform fakeVideoPlayerPlatform;
110+
111+ setUp (() {
112+ fakeVideoPlayerPlatform = FakeVideoPlayerPlatform ();
113+ VideoPlayerPlatform .instance = fakeVideoPlayerPlatform;
114+ });
115+
109116 void verifyPlayStateRespondsToLifecycle (
110117 VideoPlayerController controller, {
111118 required bool shouldPlayInBackground,
@@ -235,13 +242,6 @@ void main() {
235242 });
236243
237244 group ('VideoPlayerController' , () {
238- late FakeVideoPlayerPlatform fakeVideoPlayerPlatform;
239-
240- setUp (() {
241- fakeVideoPlayerPlatform = FakeVideoPlayerPlatform ();
242- VideoPlayerPlatform .instance = fakeVideoPlayerPlatform;
243- });
244-
245245 group ('initialize' , () {
246246 test ('started app lifecycle observing' , () async {
247247 final VideoPlayerController controller = VideoPlayerController .network (
@@ -1015,13 +1015,6 @@ void main() {
10151015 });
10161016
10171017 group ('VideoPlayerOptions' , () {
1018- late FakeVideoPlayerPlatform fakeVideoPlayerPlatform;
1019-
1020- setUp (() {
1021- fakeVideoPlayerPlatform = FakeVideoPlayerPlatform ();
1022- VideoPlayerPlatform .instance = fakeVideoPlayerPlatform;
1023- });
1024-
10251018 test ('setMixWithOthers' , () async {
10261019 final VideoPlayerController controller = VideoPlayerController .network (
10271020 'https://127.0.0.1' ,
@@ -1160,6 +1153,11 @@ class FakeVideoPlayerPlatform extends VideoPlayerPlatform {
11601153 Future <void > setMixWithOthers (bool mixWithOthers) async {
11611154 calls.add ('setMixWithOthers' );
11621155 }
1156+
1157+ @override
1158+ Widget buildView (int textureId) {
1159+ return Texture (textureId: textureId);
1160+ }
11631161}
11641162
11651163/// This allows a value of type T or T? to be treated as a value of type T?.
0 commit comments