Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
38e5047
flutter create output, unmodified
stuartmorgan-g Sep 21, 2023
d56fbd9
Add licenses
stuartmorgan-g Sep 21, 2023
b6c6e4c
Add macOS metadata
stuartmorgan-g Sep 21, 2023
d93570f
Move source to shared location
stuartmorgan-g Sep 21, 2023
f6aee72
Automatic build changes
stuartmorgan-g Sep 21, 2023
d49c0f5
Update Pigeon to pick up macOS Obj-C support
stuartmorgan-g Sep 21, 2023
10f3496
Shared native tests
stuartmorgan-g Sep 21, 2023
d784b63
Initial compilation fixes
stuartmorgan-g Sep 21, 2023
3223b94
Conditionalize UIViewController usage
stuartmorgan-g Sep 21, 2023
e510c37
Initial pass at CVDisplayLink
stuartmorgan-g Sep 21, 2023
dcb3f33
Network entitlement for example
stuartmorgan-g Sep 21, 2023
5de83d6
Add workaround for asset loading issue
stuartmorgan-g Sep 22, 2023
194ed77
Missing display link bits
stuartmorgan-g Sep 22, 2023
66a1c50
Add display link comments and don't change iOS here
stuartmorgan-g Sep 22, 2023
1022796
Fix unit tests
stuartmorgan-g Sep 22, 2023
4806a6d
Unwind XCUITests
stuartmorgan-g Sep 22, 2023
797fa8d
Add macOS support
stuartmorgan-g Sep 22, 2023
1d8ebd4
Remove symlinks; they aren't needed for supported versions
stuartmorgan-g Sep 22, 2023
7a84011
Add support for stable
stuartmorgan-g Sep 22, 2023
22246f7
Require 3.13 due to lookupKeyForAsset
stuartmorgan-g Sep 22, 2023
bc8953d
Disable a warning that's flagging intentional test behavior
stuartmorgan-g Sep 22, 2023
30b5011
Merge branch 'main' into video-player-macos
stuartmorgan-g Sep 26, 2023
1007020
Add a flag to clear Flutter caches
stuartmorgan-g Sep 26, 2023
04b0ff9
Add the flag
stuartmorgan-g Sep 26, 2023
09d60e4
Merge branch 'main' into video-player-macos
stuartmorgan-g Sep 26, 2023
144aeca
Revert "Add the flag"
stuartmorgan-g Sep 27, 2023
2bd1448
Revert "Add a flag to clear Flutter caches"
stuartmorgan-g Sep 27, 2023
18da78b
Temporarily add verbose to linting
stuartmorgan-g Sep 27, 2023
6a45c4d
Reorder properties
stuartmorgan-g Sep 27, 2023
51f4f8f
Revert "Temporarily add verbose to linting"
stuartmorgan-g Sep 27, 2023
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
Conditionalize UIViewController usage
  • Loading branch information
stuartmorgan-g committed Sep 21, 2023
commit 3223b943ed5602c98b55c41762d21f588c48b894
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ @interface FLTVideoPlayer : NSObject <FlutterTexture, FlutterStreamHandler>
// for issue #1, and restore the correct width and height for issue #2.
@property(readonly, nonatomic) AVPlayerLayer *playerLayer;
@property(readonly, nonatomic) CADisplayLink *displayLink;
@property(readonly, nonatomic) CALayer *flutterViewLayer;
@property(nonatomic) FlutterEventChannel *eventChannel;
@property(nonatomic) FlutterEventSink eventSink;
@property(nonatomic) CGAffineTransform preferredTransform;
Expand Down Expand Up @@ -153,15 +154,6 @@ NS_INLINE CGFloat radiansToDegrees(CGFloat radians) {
return degrees;
};

NS_INLINE UIViewController *rootViewController(void) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
// TODO: (hellohuanlin) Provide a non-deprecated codepath. See
// https://github.com/flutter/flutter/issues/104117
return UIApplication.sharedApplication.keyWindow.rootViewController;
#pragma clang diagnostic pop
}

- (AVMutableVideoComposition *)getVideoCompositionWithTransform:(CGAffineTransform)transform
withAsset:(AVAsset *)asset
withVideoTrack:(AVAssetTrack *)videoTrack {
Expand Down Expand Up @@ -265,7 +257,7 @@ - (instancetype)initWithPlayerItem:(AVPlayerItem *)item
// invisible AVPlayerLayer is used to overwrite the protection of pixel buffers in those streams
// for issue #1, and restore the correct width and height for issue #2.
_playerLayer = [AVPlayerLayer playerLayerWithPlayer:_player];
[rootViewController().view.layer addSublayer:_playerLayer];
[self.flutterViewLayer addSublayer:_playerLayer];

[self createVideoOutputAndDisplayLink:frameUpdater];

Expand Down Expand Up @@ -717,4 +709,18 @@ - (void)setMixWithOthers:(FLTMixWithOthersMessage *)input
#endif
}

- (CALayer *)flutterViewLayer {
#if TARGET_OS_OSX
return self.registrar.view.layer;
#else
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
// TODO(hellohuanlin): Provide a non-deprecated codepath. See
// https://github.com/flutter/flutter/issues/104117
UIViewController *root = UIApplication.sharedApplication.keyWindow.rootViewController;
#pragma clang diagnostic pop
return root.view.layer;
#endif
}

@end