mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Merge branch 'macos-release-11.6'
This commit is contained in:
commit
479cd3b55f
@ -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
|
||||
@ -1226,6 +1275,12 @@ public final class OngoingGroupCallContext {
|
||||
impl.stop(account: account, reportCallId: reportCallId)
|
||||
}
|
||||
}
|
||||
|
||||
public func makeIncomingVideoView(endpointId: String, requestClone: Bool, completion: @escaping (OngoingCallContextPresentationCallVideoView?, OngoingCallContextPresentationCallVideoView?) -> Void) {
|
||||
self.impl.with { impl in
|
||||
impl.makeIncomingVideoView(endpointId: endpointId, requestClone: requestClone, completion: completion)
|
||||
}
|
||||
}
|
||||
|
||||
public func video(endpointId: String) -> Signal<OngoingGroupCallContext.VideoFrameData, NoError> {
|
||||
return Signal { subscriber in
|
||||
|
Loading…
x
Reference in New Issue
Block a user