Add kilsswitches

This commit is contained in:
Isaac 2025-01-29 23:02:11 +04:00
parent 47b0315671
commit b5b720e4c0
3 changed files with 40 additions and 8 deletions

View File

@ -2489,7 +2489,15 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
self.context.sharedContext.mediaManager.setOverlayVideoNode(nil)
} else {
let scrubberTransition = (node.0 as? GalleryItemTransitionNode)?.scrubberTransition()
var scrubberTransition = (node.0 as? GalleryItemTransitionNode)?.scrubberTransition()
if let data = self.context.currentAppConfiguration.with({ $0 }).data {
if let value = data["ios_gallery_scrubber_transition"] as? Double {
if value == 0.0 {
scrubberTransition = nil
}
}
}
if let scrubberView = self.scrubberView {
scrubberView.animateIn(from: scrubberTransition, transition: .animated(duration: 0.25, curve: .spring))
@ -2633,7 +2641,14 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
return
}
let scrubberTransition = (node.0 as? GalleryItemTransitionNode)?.scrubberTransition()
var scrubberTransition = (node.0 as? GalleryItemTransitionNode)?.scrubberTransition()
if let data = self.context.currentAppConfiguration.with({ $0 }).data {
if let value = data["ios_gallery_scrubber_transition"] as? Double {
if value == 0.0 {
scrubberTransition = nil
}
}
}
if let scrubberView = self.scrubberView {
var scrubberEffectiveTransition = scrubberTransition

View File

@ -1260,11 +1260,12 @@ public final class GroupCallParticipantsContext {
sortAgain = true
}
if let hasLocalVideoPeerId = state.overlayState.hasLocalVideo, hasLocalVideoPeerId == publicState.participants[i].peer.id {
//TODO:wip-release
/*if let hasLocalVideoPeerId = state.overlayState.hasLocalVideo, hasLocalVideoPeerId == publicState.participants[i].peer.id {
if publicState.participants[i].videoDescription == nil {
publicState.participants[i].videoDescription = GroupCallParticipantsContext.Participant.VideoDescription(endpointId: "_local", ssrcGroups: [], audioSsrc: nil, isPaused: false)
}
}
}*/
}
if sortAgain {
publicState.participants.sort(by: { GroupCallParticipantsContext.Participant.compare(lhs: $0, rhs: $1, sortAscending: publicState.sortAscending) })
@ -1954,9 +1955,10 @@ public final class GroupCallParticipantsContext {
self.localIsVideoPaused = isVideoPaused
self.localIsPresentationPaused = isPresentationPaused
if let isVideoMuted {
//TODO:wip-release
/*if let isVideoMuted {
self.stateValue.overlayState.hasLocalVideo = isVideoMuted ? nil : peerId
}
}*/
let disposable = MetaDisposable()

View File

@ -868,12 +868,27 @@ public final class ChatMessageInteractiveMediaNode: ASDisplayNode, GalleryItemTr
let _ = peerType
var useInlineHLS = true
var displayInlineScrubber = true
var startFromSavedPosition = true
if let data = context.currentAppConfiguration.with({ $0 }).data {
if let value = data["ios_inline_hls_v2"] as? Double {
useInlineHLS = value != 0.0
}
if let value = data["ios_inline_scrubber"] as? Double {
displayInlineScrubber = value != 0.0
}
if let value = data["ios_inline_continue"] as? Double {
startFromSavedPosition = value != 0.0
}
}
/*#if DEBUG
if "".isEmpty {
displayInlineScrubber = false
startFromSavedPosition = false
}
#endif*/
var nativeSize: CGSize
let isSecretMedia = message.containsSecretMedia
@ -1940,7 +1955,7 @@ public final class ChatMessageInteractiveMediaNode: ASDisplayNode, GalleryItemTr
if let strongSelf = self {
if firstTime {
firstTime = false
if let videoTimestamp {
if startFromSavedPosition, let videoTimestamp {
videoNode.seek(Double(videoTimestamp))
}
}
@ -2028,7 +2043,7 @@ public final class ChatMessageInteractiveMediaNode: ASDisplayNode, GalleryItemTr
}
}
if let videoTimestamp, let file = media as? TelegramMediaFile, let duration = file.duration, duration > 1.0 {
if displayInlineScrubber, let videoTimestamp, let file = media as? TelegramMediaFile, let duration = file.duration, duration > 1.0 {
let timestampContainerView: UIView
if let current = strongSelf.timestampContainerView {
timestampContainerView = current