mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
macos related changes
This commit is contained in:
@@ -986,6 +986,55 @@ public final class OngoingGroupCallContext {
|
||||
func switchAudioOutput(_ deviceId: String) {
|
||||
self.context.switchAudioOutput(deviceId)
|
||||
}
|
||||
|
||||
func makeIncomingVideoView(endpointId: String, requestClone: Bool, completion: @escaping (OngoingCallContextPresentationCallVideoView?, OngoingCallContextPresentationCallVideoView?) -> Void) {
|
||||
self.context.makeIncomingVideoView(withEndpointId: endpointId, requestClone: requestClone, completion: { mainView, cloneView in
|
||||
if let mainView = mainView {
|
||||
#if os(macOS)
|
||||
let mainVideoView = OngoingCallContextPresentationCallVideoView(
|
||||
view: mainView,
|
||||
setOnFirstFrameReceived: { [weak mainView] f in
|
||||
mainView?.setOnFirstFrameReceived(f)
|
||||
},
|
||||
getOrientation: { [weak mainView] in
|
||||
if let mainView = mainView {
|
||||
return OngoingCallVideoOrientation(mainView.orientation)
|
||||
} else {
|
||||
return .rotation0
|
||||
}
|
||||
},
|
||||
getAspect: { [weak mainView] in
|
||||
if let mainView = mainView {
|
||||
return mainView.aspect
|
||||
} else {
|
||||
return 0.0
|
||||
}
|
||||
},
|
||||
setOnOrientationUpdated: { [weak mainView] f in
|
||||
mainView?.setOnOrientationUpdated { value, aspect in
|
||||
f?(OngoingCallVideoOrientation(value), aspect)
|
||||
}
|
||||
}, setVideoContentMode: { [weak mainView] mode in
|
||||
mainView?.setVideoContentMode(mode)
|
||||
},
|
||||
setOnIsMirroredUpdated: { [weak mainView] f in
|
||||
mainView?.setOnIsMirroredUpdated { value in
|
||||
f?(value)
|
||||
}
|
||||
}, setIsPaused: { [weak mainView] paused in
|
||||
mainView?.setIsPaused(paused)
|
||||
}, renderToSize: { [weak mainView] size, animated in
|
||||
mainView?.render(to: size, animated: animated)
|
||||
}
|
||||
)
|
||||
completion(mainVideoView, nil)
|
||||
#endif
|
||||
} else {
|
||||
completion(nil, nil)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
func video(endpointId: String) -> Signal<OngoingGroupCallContext.VideoFrameData, NoError> {
|
||||
let queue = self.queue
|
||||
|
||||
Reference in New Issue
Block a user