13
13
import static org .mockito .Mockito .spy ;
14
14
import static org .mockito .Mockito .times ;
15
15
16
- import androidx .media3 .common .Format ;
17
16
import androidx .media3 .common .PlaybackException ;
18
17
import androidx .media3 .common .Player ;
18
+ import androidx .media3 .common .VideoSize ;
19
19
import androidx .media3 .datasource .DefaultHttpDataSource ;
20
20
import androidx .media3 .exoplayer .ExoPlayer ;
21
21
import io .flutter .plugin .common .EventChannel ;
@@ -135,10 +135,9 @@ public void sendInitializedSendsExpectedEvent_90RotationDegrees() {
135
135
fakeVideoPlayerOptions ,
136
136
fakeEventSink ,
137
137
httpDataSourceFactorySpy );
138
- Format testFormat =
139
- new Format .Builder ().setWidth (100 ).setHeight (200 ).setRotationDegrees (90 ).build ();
138
+ VideoSize testVideoSize = new VideoSize (100 , 200 , 90 , 1f );
140
139
141
- when (fakeExoPlayer .getVideoFormat ()).thenReturn (testFormat );
140
+ when (fakeExoPlayer .getVideoSize ()).thenReturn (testVideoSize );
142
141
when (fakeExoPlayer .getDuration ()).thenReturn (10L );
143
142
144
143
videoPlayer .isInitialized = true ;
@@ -164,10 +163,9 @@ public void sendInitializedSendsExpectedEvent_270RotationDegrees() {
164
163
fakeVideoPlayerOptions ,
165
164
fakeEventSink ,
166
165
httpDataSourceFactorySpy );
167
- Format testFormat =
168
- new Format .Builder ().setWidth (100 ).setHeight (200 ).setRotationDegrees (270 ).build ();
166
+ VideoSize testVideoSize = new VideoSize (100 , 200 , 270 , 1f );
169
167
170
- when (fakeExoPlayer .getVideoFormat ()).thenReturn (testFormat );
168
+ when (fakeExoPlayer .getVideoSize ()).thenReturn (testVideoSize );
171
169
when (fakeExoPlayer .getDuration ()).thenReturn (10L );
172
170
173
171
videoPlayer .isInitialized = true ;
@@ -193,10 +191,9 @@ public void sendInitializedSendsExpectedEvent_0RotationDegrees() {
193
191
fakeVideoPlayerOptions ,
194
192
fakeEventSink ,
195
193
httpDataSourceFactorySpy );
196
- Format testFormat =
197
- new Format .Builder ().setWidth (100 ).setHeight (200 ).setRotationDegrees (0 ).build ();
194
+ VideoSize testVideoSize = new VideoSize (100 , 200 , 0 , 1f );
198
195
199
- when (fakeExoPlayer .getVideoFormat ()).thenReturn (testFormat );
196
+ when (fakeExoPlayer .getVideoSize ()).thenReturn (testVideoSize );
200
197
when (fakeExoPlayer .getDuration ()).thenReturn (10L );
201
198
202
199
videoPlayer .isInitialized = true ;
@@ -222,10 +219,9 @@ public void sendInitializedSendsExpectedEvent_180RotationDegrees() {
222
219
fakeVideoPlayerOptions ,
223
220
fakeEventSink ,
224
221
httpDataSourceFactorySpy );
225
- Format testFormat =
226
- new Format .Builder ().setWidth (100 ).setHeight (200 ).setRotationDegrees (180 ).build ();
222
+ VideoSize testVideoSize = new VideoSize (100 , 200 , 180 , 1f );
227
223
228
- when (fakeExoPlayer .getVideoFormat ()).thenReturn (testFormat );
224
+ when (fakeExoPlayer .getVideoSize ()).thenReturn (testVideoSize );
229
225
when (fakeExoPlayer .getDuration ()).thenReturn (10L );
230
226
231
227
videoPlayer .isInitialized = true ;
0 commit comments