Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: facbe72f14ef35005af22fe8d56ded0105305d8f
https://github.com/WebKit/WebKit/commit/facbe72f14ef35005af22fe8d56ded0105305d8f
Author: Richard Robinson <[email protected]>
Date: 2025-06-24 (Tue, 24 Jun 2025)
Changed paths:
M Source/WebCore/platform/ios/VideoPresentationInterfaceAVKit.h
M Source/WebCore/platform/ios/VideoPresentationInterfaceIOS.h
M Source/WebKit/Platform/ios/VideoPresentationInterfaceLMK.h
M Source/WebKit/Platform/ios/VideoPresentationInterfaceLMK.mm
M Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.h
M Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.mm
M Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm
M Source/WebKit/WebKit.xcodeproj/project.pbxproj
R Source/WebKit/WebKitSwift/LinearMediaKit/LinearMediaKitExtras.h
R Source/WebKit/WebKitSwift/LinearMediaKit/LinearMediaKitExtras.swift
R Source/WebKit/WebKitSwift/LinearMediaKit/LinearMediaKitSPI.h
M Source/WebKit/WebKitSwift/LinearMediaKit/LinearMediaPlayer.swift
M Source/WebKit/WebKitSwift/LinearMediaKit/LinearMediaTypes.swift
M Source/WebKit/WebKitSwift/LinearMediaKit/WKSLinearMediaPlayer.h
M Source/WebKit/WebKitSwift/LinearMediaKit/WKSLinearMediaTypes.h
M Source/WebKit/WebKitSwift/WebKitSwift.h
Log Message:
-----------
[Swift in WebKit] Fix Swift 6 warnings and errors in WKSLinearMediaPlayer
https://bugs.webkit.org/show_bug.cgi?id=294823
rdar://154057962
Reviewed by Andy Estes.
Address Swift 6 errors in WKSLinearMediaPlayer and related code.
- If it walks like a duck and talks like a duck... it's not always a duck. In
this case, AVKit has a public
Swift class `PlayableViewController` and annotated with
`@objc(LMPlayableViewController)`. This annotation
makes the type compatible and indistuinguishable from an Objective C type.
However, Swift types cannot be accessed
by Objective-C in another framework; within their own framework, the Swift
bridging header is used.
AVKit attempted to work around this by creating an Objective-C interface that
was essentially a forward declaration
of `LMPlayableViewController`; this is an unsupported configuration as it
removes all compile-time checking, which
results in the Swift compiler being confused.
To fix, the `LMPlayableViewController` type is now never used within WebKit;
only the `PlayableViewController` type
is used from within Swift WebKit code. Consequently, a new wrapper type is
created that abstracts the
`PlayableViewController` and exposes the needed symbols to Objective-C, so that
the compiler can function properly.
- Use `@objc @implementation` instead of `@_objcImplementation`.
- Use `RealityKit` instead of the re-exported `RealityFoundation` module.
- Adopt `@preconcurrency` when needed, to silence errors due to the underlying
framework symbols
not having proper annotations.
* Source/WebCore/platform/ios/VideoPresentationInterfaceAVKit.h:
* Source/WebCore/platform/ios/VideoPresentationInterfaceIOS.h:
(WebCore::VideoPresentationInterfaceIOS::playableViewController):
* Source/WebKit/Platform/ios/VideoPresentationInterfaceLMK.h:
* Source/WebKit/Platform/ios/VideoPresentationInterfaceLMK.mm:
(WebKit::VideoPresentationInterfaceLMK::setupFullscreen):
(WebKit::VideoPresentationInterfaceLMK::enterExternalPlayback):
(WebKit::VideoPresentationInterfaceLMK::playerViewController const):
(WebKit::VideoPresentationInterfaceLMK::playableViewController):
(WebKit::VideoPresentationInterfaceLMK::ensurePlayableViewController):
* Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.h:
* Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.mm:
(WebKit::VideoPresentationManagerProxy::playableViewController const):
* Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(-[WKFullScreenViewController
configureEnvironmentPickerOrFullscreenVideoButtonView]):
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKit/WebKitSwift/LinearMediaKit/LinearMediaKitExtras.h: Removed.
* Source/WebKit/WebKitSwift/LinearMediaKit/LinearMediaKitExtras.swift: Removed.
* Source/WebKit/WebKitSwift/LinearMediaKit/LinearMediaKitSPI.h: Removed.
* Source/WebKit/WebKitSwift/LinearMediaKit/LinearMediaPlayer.swift:
(SwiftOnlyData.viewController):
(WKSLinearMediaPlayer.makeViewController):
(WKSLinearMediaPlayer.enterExternalPresentation(_:(any Error)?) -> Void:)):
(WKSLinearMediaPlayer.exitExternalPresentation(_:(any Error)?) -> Void:)):
(WKSLinearMediaPlayer.enterFullscreen(_:(any Error)?) -> Void:)):
(WKSLinearMediaPlayer.exitFullscreen(_:(any Error)?) -> Void:)):
(WKSLinearMediaPlayer.maybeCreateSpatialOrImmersiveEntity):
(WKSLinearMediaPlayer.maybeClearSpatialOrImmersiveEntity):
* Source/WebKit/WebKitSwift/LinearMediaKit/LinearMediaTypes.swift:
(WKSPlayableViewControllerHost.baseViewController):
(WKSPlayableViewControllerHost.automaticallyDockOnFullScreenPresentation):
(WKSPlayableViewControllerHost.dismissFullScreenOnExitingDocking):
(WKSPlayableViewControllerHost.environmentPickerButtonViewController):
(WKSPlayableViewControllerHost.playable):
(WKSPlayableViewControllerHost.prefersAutoDimming):
* Source/WebKit/WebKitSwift/LinearMediaKit/WKSLinearMediaPlayer.h:
* Source/WebKit/WebKitSwift/LinearMediaKit/WKSLinearMediaTypes.h:
* Source/WebKit/WebKitSwift/WebKitSwift.h:
Canonical link: https://commits.webkit.org/296600@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes