Skip to content
Merged
Prev Previous commit
Fix macOS compilation warnings
  • Loading branch information
stuartmorgan-g committed Jul 8, 2025
commit e1f606544eb6e0a57f7b00f69a46ba271c95c85a
Original file line number Diff line number Diff line change
Expand Up @@ -603,13 +603,11 @@ - (void)testSeekToleranceWhenNotSeekingToEnd {
StubAVPlayer *stubAVPlayer = [[StubAVPlayer alloc] init];
StubFVPAVFactory *stubAVFactory = [[StubFVPAVFactory alloc] initWithPlayer:stubAVPlayer
output:nil];
FVPVideoPlayer *player = [[FVPVideoPlayer alloc]
initWithURL:
[NSURL
URLWithString:@"https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4"]
httpHeaders:@{}
avFactory:stubAVFactory
viewProvider:[[StubViewProvider alloc] initWithView:nil]];
FVPVideoPlayer *player =
[[FVPVideoPlayer alloc] initWithURL:self.mp4TestURL
httpHeaders:@{}
avFactory:stubAVFactory
viewProvider:[[StubViewProvider alloc] initWithView:nil]];

XCTestExpectation *seekExpectation =
[self expectationWithDescription:@"seekTo has zero tolerance when seeking not to end"];
Expand All @@ -627,13 +625,11 @@ - (void)testSeekToleranceWhenSeekingToEnd {
StubAVPlayer *stubAVPlayer = [[StubAVPlayer alloc] init];
StubFVPAVFactory *stubAVFactory = [[StubFVPAVFactory alloc] initWithPlayer:stubAVPlayer
output:nil];
FVPVideoPlayer *player = [[FVPVideoPlayer alloc]
initWithURL:
[NSURL
URLWithString:@"https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4"]
httpHeaders:@{}
avFactory:stubAVFactory
viewProvider:[[StubViewProvider alloc] initWithView:nil]];
FVPVideoPlayer *player =
[[FVPVideoPlayer alloc] initWithURL:self.mp4TestURL
httpHeaders:@{}
avFactory:stubAVFactory
viewProvider:[[StubViewProvider alloc] initWithView:nil]];

XCTestExpectation *seekExpectation =
[self expectationWithDescription:@"seekTo has non-zero tolerance when seeking to end"];
Expand All @@ -649,9 +645,11 @@ - (void)testSeekToleranceWhenSeekingToEnd {

/// Sanity checks a video player playing the given URL with the actual AVPlayer. This is essentially
/// a mini integration test of the player component.
- (NSDictionary<NSString *, id> *)sanityTestURI:(NSString *)uri {
- (NSDictionary<NSString *, id> *)sanityTestURI:(NSString *)testURI {
NSURL *testURL = [NSURL URLWithString:testURI];
XCTAssertNotNil(testURL);
FVPVideoPlayer *player =
[[FVPVideoPlayer alloc] initWithURL:[NSURL URLWithString:uri]
[[FVPVideoPlayer alloc] initWithURL:testURL
httpHeaders:@{}
avFactory:[[FVPDefaultAVFactory alloc] init]
viewProvider:[[StubViewProvider alloc] initWithView:nil]];
Expand Down Expand Up @@ -864,13 +862,11 @@ - (void)testFailedToLoadVideoEventShouldBeAlwaysSent {
}

- (void)testUpdatePlayingStateShouldNotResetRate {
FVPVideoPlayer *player = [[FVPVideoPlayer alloc]
initWithURL:
[NSURL
URLWithString:@"https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4"]
httpHeaders:@{}
avFactory:[[StubFVPAVFactory alloc] initWithPlayer:nil output:nil]
viewProvider:[[StubViewProvider alloc] initWithView:nil]];
FVPVideoPlayer *player =
[[FVPVideoPlayer alloc] initWithURL:self.mp4TestURL
httpHeaders:@{}
avFactory:[[StubFVPAVFactory alloc] initWithPlayer:nil output:nil]
viewProvider:[[StubViewProvider alloc] initWithView:nil]];

XCTestExpectation *initializedExpectation = [self expectationWithDescription:@"initialized"];
[player onListenWithArguments:nil
Expand Down Expand Up @@ -1038,4 +1034,10 @@ - (void)validateTransformFixForOrientation:(UIImageOrientation)orientation {
}
#endif

/// Returns a test URL for creating a player from a network source.
- (nonnull NSURL *)mp4TestURL {
return (NSURL *_Nonnull)[NSURL
URLWithString:@"https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4"];
}

@end