Skip to content

Commit

Permalink
Upstream visionOS-specific AVKit usage
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=258371
rdar://111125631

Reviewed by Tim Horton.

* Source/WebCore/PAL/pal/spi/cocoa/AVKitSPI.h:
* Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewController initWithFullscreenInterface:]):

Canonical link: https://commits.webkit.org/265384@main
  • Loading branch information
pxlcoder committed Jun 22, 2023
1 parent 65eff3f commit 0e11706
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
14 changes: 14 additions & 0 deletions Source/WebCore/PAL/pal/spi/cocoa/AVKitSPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -401,3 +401,17 @@ NS_ASSUME_NONNULL_END

#endif // HAVE(PIP_CONTROLLER)

#if PLATFORM(VISION)

// FIXME: rdar://111125392 – import SPI using a header, following rdar://111123290.

typedef NS_OPTIONS(NSUInteger, AVPlayerViewControllerFullScreenBehaviors) {
AVPlayerViewControllerFullScreenBehaviorHostContentInline = 1 << 3,
};

@interface AVPlayerViewController ()
@property (nonatomic) BOOL prefersRoomDimming;
@property (nonatomic) AVPlayerViewControllerFullScreenBehaviors fullScreenBehaviors;
@end

#endif // PLATFORM(VISION)
9 changes: 3 additions & 6 deletions Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@
#import <AVKit/AVPictureInPictureController.h>
#endif

#if PLATFORM(VISION)
#import <WebKitAdditions/VideoFullscreenInterfaceAVKitAdditions.h>
#endif

using namespace WebCore;

#import <pal/cf/CoreMediaSoftLink.h>
Expand Down Expand Up @@ -408,8 +404,9 @@ - (instancetype)initWithFullscreenInterface:(VideoFullscreenInterfaceAVKit *)int
_avPlayerViewController.get().delegate = self;
#endif

#if ENABLE(FULLSCREEN_WINDOW_EFFECTS)
setupAVPlayerViewControllerForFullscreenWindowEffects(_avPlayerViewController.get());
#if PLATFORM(VISION)
[_avPlayerViewController setPrefersRoomDimming:NO];
[_avPlayerViewController setFullScreenBehaviors:AVPlayerViewControllerFullScreenBehaviorHostContentInline];
#endif

#if HAVE(PIP_CONTROLLER)
Expand Down

0 comments on commit 0e11706

Please sign in to comment.