@@ -168,32 +168,6 @@ - (instancetype)init {
168
168
169
169
@implementation VideoPlayerTests
170
170
171
- - (void )testCreateWithOptionsReturnsErrorForInvalidAssetPath {
172
- NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
173
- OCMStub ([registrar lookupKeyForAsset: [OCMArg any ]]).andReturn (nil );
174
- FVPVideoPlayerPlugin *videoPlayerPlugin =
175
- [[FVPVideoPlayerPlugin alloc ] initWithRegistrar: registrar];
176
-
177
- FlutterError *initializationError;
178
- [videoPlayerPlugin initialize: &initializationError];
179
- XCTAssertNil (initializationError);
180
-
181
- FVPCreationOptions *create =
182
- [FVPCreationOptions makeWithAsset: @" invalid/path/to/asset"
183
- uri: nil
184
- packageName: nil
185
- formatHint: nil
186
- httpHeaders: @{}
187
- viewType: FVPPlatformVideoViewTypeTextureView];
188
-
189
- FlutterError *createError;
190
- NSNumber *playerIdentifier = [videoPlayerPlugin createWithOptions: create error: &createError];
191
-
192
- XCTAssertNil (playerIdentifier);
193
- XCTAssertNotNil (createError);
194
- XCTAssertEqualObjects (createError.code , @" video_player" );
195
- }
196
-
197
171
- (void )testBlankVideoBugWithEncryptedVideoStreamAndInvertedAspectRatioBugForSomeVideoStream {
198
172
// This is to fix 2 bugs: 1. blank video for encrypted video streams on iOS 16
199
173
// (https://github.com/flutter/flutter/issues/111457) and 2. swapped width and height for some
@@ -218,12 +192,9 @@ - (void)testBlankVideoBugWithEncryptedVideoStreamAndInvertedAspectRatioBugForSom
218
192
XCTAssertNil (error);
219
193
220
194
FVPCreationOptions *create = [FVPCreationOptions
221
- makeWithAsset: nil
222
- uri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4"
223
- packageName: nil
224
- formatHint: nil
225
- httpHeaders: @{}
226
- viewType: FVPPlatformVideoViewTypeTextureView];
195
+ makeWithUri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4"
196
+ httpHeaders: @{}
197
+ viewType: FVPPlatformVideoViewTypeTextureView];
227
198
NSNumber *playerIdentifier = [videoPlayerPlugin createWithOptions: create error: &error];
228
199
XCTAssertNil (error);
229
200
XCTAssertNotNil (playerIdentifier);
@@ -253,12 +224,9 @@ - (void)testPlayerForPlatformViewDoesNotRegisterTexture {
253
224
[videoPlayerPlugin initialize: &initalizationError];
254
225
XCTAssertNil (initalizationError);
255
226
FVPCreationOptions *create = [FVPCreationOptions
256
- makeWithAsset: nil
257
- uri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/hls/bee.m3u8"
258
- packageName: nil
259
- formatHint: nil
260
- httpHeaders: @{}
261
- viewType: FVPPlatformVideoViewTypePlatformView];
227
+ makeWithUri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/hls/bee.m3u8"
228
+ httpHeaders: @{}
229
+ viewType: FVPPlatformVideoViewTypePlatformView];
262
230
FlutterError *createError;
263
231
[videoPlayerPlugin createWithOptions: create error: &createError];
264
232
@@ -284,12 +252,9 @@ - (void)testSeekToWhilePausedStartsDisplayLinkTemporarily {
284
252
[videoPlayerPlugin initialize: &initalizationError];
285
253
XCTAssertNil (initalizationError);
286
254
FVPCreationOptions *create = [FVPCreationOptions
287
- makeWithAsset: nil
288
- uri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/hls/bee.m3u8"
289
- packageName: nil
290
- formatHint: nil
291
- httpHeaders: @{}
292
- viewType: FVPPlatformVideoViewTypeTextureView];
255
+ makeWithUri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/hls/bee.m3u8"
256
+ httpHeaders: @{}
257
+ viewType: FVPPlatformVideoViewTypeTextureView];
293
258
FlutterError *createError;
294
259
NSNumber *playerIdentifier = [videoPlayerPlugin createWithOptions: create error: &createError];
295
260
FVPTextureBasedVideoPlayer *player =
@@ -344,12 +309,9 @@ - (void)testInitStartsDisplayLinkTemporarily {
344
309
[videoPlayerPlugin initialize: &initalizationError];
345
310
XCTAssertNil (initalizationError);
346
311
FVPCreationOptions *create = [FVPCreationOptions
347
- makeWithAsset: nil
348
- uri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/hls/bee.m3u8"
349
- packageName: nil
350
- formatHint: nil
351
- httpHeaders: @{}
352
- viewType: FVPPlatformVideoViewTypeTextureView];
312
+ makeWithUri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/hls/bee.m3u8"
313
+ httpHeaders: @{}
314
+ viewType: FVPPlatformVideoViewTypeTextureView];
353
315
FlutterError *createError;
354
316
NSNumber *playerIdentifier = [videoPlayerPlugin createWithOptions: create error: &createError];
355
317
@@ -393,12 +355,9 @@ - (void)testSeekToWhilePlayingDoesNotStopDisplayLink {
393
355
[videoPlayerPlugin initialize: &initalizationError];
394
356
XCTAssertNil (initalizationError);
395
357
FVPCreationOptions *create = [FVPCreationOptions
396
- makeWithAsset: nil
397
- uri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/hls/bee.m3u8"
398
- packageName: nil
399
- formatHint: nil
400
- httpHeaders: @{}
401
- viewType: FVPPlatformVideoViewTypeTextureView];
358
+ makeWithUri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/hls/bee.m3u8"
359
+ httpHeaders: @{}
360
+ viewType: FVPPlatformVideoViewTypeTextureView];
402
361
FlutterError *createError;
403
362
NSNumber *playerIdentifier = [videoPlayerPlugin createWithOptions: create error: &createError];
404
363
FVPTextureBasedVideoPlayer *player =
@@ -451,12 +410,9 @@ - (void)testPauseWhileWaitingForFrameDoesNotStopDisplayLink {
451
410
[videoPlayerPlugin initialize: &initalizationError];
452
411
XCTAssertNil (initalizationError);
453
412
FVPCreationOptions *create = [FVPCreationOptions
454
- makeWithAsset: nil
455
- uri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/hls/bee.m3u8"
456
- packageName: nil
457
- formatHint: nil
458
- httpHeaders: @{}
459
- viewType: FVPPlatformVideoViewTypeTextureView];
413
+ makeWithUri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/hls/bee.m3u8"
414
+ httpHeaders: @{}
415
+ viewType: FVPPlatformVideoViewTypeTextureView];
460
416
FlutterError *createError;
461
417
NSNumber *playerIdentifier = [videoPlayerPlugin createWithOptions: create error: &createError];
462
418
FVPTextureBasedVideoPlayer *player =
@@ -481,12 +437,9 @@ - (void)testDeregistersFromPlayer {
481
437
XCTAssertNil (error);
482
438
483
439
FVPCreationOptions *create = [FVPCreationOptions
484
- makeWithAsset: nil
485
- uri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4"
486
- packageName: nil
487
- formatHint: nil
488
- httpHeaders: @{}
489
- viewType: FVPPlatformVideoViewTypeTextureView];
440
+ makeWithUri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4"
441
+ httpHeaders: @{}
442
+ viewType: FVPPlatformVideoViewTypeTextureView];
490
443
NSNumber *playerIdentifier = [videoPlayerPlugin createWithOptions: create error: &error];
491
444
XCTAssertNil (error);
492
445
XCTAssertNotNil (playerIdentifier);
@@ -513,12 +466,9 @@ - (void)testBufferingStateFromPlayer {
513
466
XCTAssertNil (error);
514
467
515
468
FVPCreationOptions *create = [FVPCreationOptions
516
- makeWithAsset: nil
517
- uri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4"
518
- packageName: nil
519
- formatHint: nil
520
- httpHeaders: @{}
521
- viewType: FVPPlatformVideoViewTypeTextureView];
469
+ makeWithUri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4"
470
+ httpHeaders: @{}
471
+ viewType: FVPPlatformVideoViewTypeTextureView];
522
472
NSNumber *playerIdentifier = [videoPlayerPlugin createWithOptions: create error: &error];
523
473
XCTAssertNil (error);
524
474
XCTAssertNotNil (playerIdentifier);
@@ -709,12 +659,9 @@ - (void)testDoesNotCrashOnRateObservationAfterDisposal {
709
659
XCTAssertNil (error);
710
660
711
661
FVPCreationOptions *create = [FVPCreationOptions
712
- makeWithAsset: nil
713
- uri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4"
714
- packageName: nil
715
- formatHint: nil
716
- httpHeaders: @{}
717
- viewType: FVPPlatformVideoViewTypeTextureView];
662
+ makeWithUri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4"
663
+ httpHeaders: @{}
664
+ viewType: FVPPlatformVideoViewTypeTextureView];
718
665
NSNumber *playerIdentifier = [videoPlayerPlugin createWithOptions: create error: &error];
719
666
XCTAssertNil (error);
720
667
XCTAssertNotNil (playerIdentifier);
@@ -763,12 +710,9 @@ - (void)testHotReloadDoesNotCrash {
763
710
XCTAssertNil (error);
764
711
765
712
FVPCreationOptions *create = [FVPCreationOptions
766
- makeWithAsset: nil
767
- uri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4"
768
- packageName: nil
769
- formatHint: nil
770
- httpHeaders: @{}
771
- viewType: FVPPlatformVideoViewTypeTextureView];
713
+ makeWithUri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4"
714
+ httpHeaders: @{}
715
+ viewType: FVPPlatformVideoViewTypeTextureView];
772
716
NSNumber *playerIdentifier = [videoPlayerPlugin createWithOptions: create error: &error];
773
717
XCTAssertNil (error);
774
718
XCTAssertNotNil (playerIdentifier);
@@ -830,13 +774,9 @@ - (void)testFailedToLoadVideoEventShouldBeAlwaysSent {
830
774
831
775
[videoPlayerPlugin initialize: &error];
832
776
833
- FVPCreationOptions *create =
834
- [FVPCreationOptions makeWithAsset: nil
835
- uri: @" "
836
- packageName: nil
837
- formatHint: nil
838
- httpHeaders: @{}
839
- viewType: FVPPlatformVideoViewTypeTextureView];
777
+ FVPCreationOptions *create = [FVPCreationOptions makeWithUri: @" "
778
+ httpHeaders: @{}
779
+ viewType: FVPPlatformVideoViewTypeTextureView];
840
780
NSNumber *playerIdentifier = [videoPlayerPlugin createWithOptions: create error: &error];
841
781
FVPVideoPlayer *player = videoPlayerPlugin.playersByIdentifier [playerIdentifier];
842
782
XCTAssertNotNil (player);
@@ -896,12 +836,9 @@ - (void)testPlayerShouldNotDropEverySecondFrame {
896
836
[videoPlayerPlugin initialize: &error];
897
837
XCTAssertNil (error);
898
838
FVPCreationOptions *create = [FVPCreationOptions
899
- makeWithAsset: nil
900
- uri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4"
901
- packageName: nil
902
- formatHint: nil
903
- httpHeaders: @{}
904
- viewType: FVPPlatformVideoViewTypeTextureView];
839
+ makeWithUri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4"
840
+ httpHeaders: @{}
841
+ viewType: FVPPlatformVideoViewTypeTextureView];
905
842
NSNumber *playerIdentifier = [videoPlayerPlugin createWithOptions: create error: &error];
906
843
FVPTextureBasedVideoPlayer *player =
907
844
(FVPTextureBasedVideoPlayer *)videoPlayerPlugin.playersByIdentifier [playerIdentifier];
0 commit comments