mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 14:45:21 +00:00
macos related changes
This commit is contained in:
@@ -987,6 +987,55 @@ public final class OngoingGroupCallContext {
|
|||||||
self.context.switchAudioOutput(deviceId)
|
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> {
|
func video(endpointId: String) -> Signal<OngoingGroupCallContext.VideoFrameData, NoError> {
|
||||||
let queue = self.queue
|
let queue = self.queue
|
||||||
return Signal { [weak self] subscriber in
|
return Signal { [weak self] subscriber in
|
||||||
|
|||||||
Reference in New Issue
Block a user