Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Combine factories, slight adjustments
  • Loading branch information
stuartmorgan-g committed Jul 7, 2025
commit b99e45ea4696b3ec1c8019cf5cce475ffd84ad46
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,16 @@ - (instancetype)initWithMessenger:(NSObject<FlutterBinaryMessenger> *)messenger
return self;
}

#pragma mark - FlutterPlatformViewFactory

#if TARGET_OS_OSX
- (NSView *)createWithViewIdentifier:(int64_t)viewIdentifier
arguments:(FVPPlatformVideoViewCreationParams *)args {
#else
- (NSObject<FlutterPlatformView> *)createWithFrame:(CGRect)frame
viewIdentifier:(int64_t)viewIdentifier
arguments:(FVPPlatformVideoViewCreationParams *)args {
#endif
NSNumber *playerIdentifier = @(args.playerId);
FVPVideoPlayer *player = self.playerByIdProvider(playerIdentifier);
return [[FVPNativeVideoView alloc] initWithPlayer:player.player];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ - (void)layout {
[self.playerLayer displayIfNeeded];
}

- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}

@end

@interface FVPNativeVideoView ()
Expand All @@ -60,7 +56,7 @@ @implementation FVPNativeVideoView
- (instancetype)initWithPlayer:(AVPlayer *)player {
self = [super init];
if (self) {
_playerView = [[FVPPlayerView alloc] initWithFrame:NSMakeRect(0, 0, 640, 480)];
_playerView = [[FVPPlayerView alloc] initWithFrame:NSMakeRect(0, 0, 1, 1)];
[_playerView setPlayer:player];
[self addSubview:_playerView];

Expand All @@ -80,4 +76,4 @@ - (FVPPlayerView *)view {
return self.playerView;
}

@end
@end

This file was deleted.