Is there a delegate for the stop sharing button in Sonoma?

Hey team -- looking to receive a delegate callback in Sonoma for screencapturekit when the toolbar portion of stop sharing is called. Does this come through in any of these?

/**
 @abstract stream:didStopStreamWithError:
 @param stream the SCStream object
 @param error the error denoted by the stopping of the stream
 @discussion notifies the delegate that the stream has stopped and the error associated with it
*/
optional func stream(_ stream: SCStream, didStopWithError error: Error)


/**
 @abstract outputVideoEffectDidStartForStream:
 @param stream the SCStream object
 @discussion notifies the delegate that the stream's overlay video effect has started.
*/
@available(macOS 14.0, *)
optional func outputVideoEffectDidStart(for stream: SCStream)


/**
 @abstract stream:outputVideoEffectDidStart:
 @param stream the SCStream object
 @discussion notifies the delegate that the stream's overlay video  effect has stopped.
*/
@available(macOS 14.0, *)
optional func outputVideoEffectDidStop(for stream: SCStream)

Replies

Nevermind, answered my own question. Comes through in:

func stream(_ stream: SCStream, didStopWithError error: Error) {
    errorOccurred?(error)
}

Error Domain=com.apple.ScreenCaptureKit.SCStreamErrorDomain Code=-3817 "The user stopped the stream" UserInfo={NSLocalizedDescription=The user stopped the stream}

Also for anyone seeing this in the future, the delegate callbacks from the WWDC video have been changed:

func stream(_ stream: SCStream, outputEffectDidStart didStart: bool) {
    // if Presenter Overlay is on, present banner in app to notify
    if didStart == true {
        presentBanner()
        turnOffCamera()
    } else {
        turnOnCamera()
    }
}

to

func outputVideoEffectDidStart(for stream: SCStream) {}
    
func outputVideoEffectDidStop(for stream: SCStream) {}