Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios

This commit is contained in:
Ilya Laktyushin 2023-06-27 23:31:55 +02:00
commit c38c6827d6
23 changed files with 911 additions and 570 deletions

View File

@ -9,15 +9,16 @@ open class SparseNode: ASDisplayNode {
if self.alpha.isZero {
return nil
}
if !self.bounds.inset(by: self.hitTestSlop).contains(point) {
return nil
}
for view in self.view.subviews.reversed() {
if let result = view.hitTest(self.view.convert(point, to: view), with: event), result.isUserInteractionEnabled {
return result
}
}
if !self.bounds.inset(by: self.hitTestSlop).contains(point) {
return nil
}
let result = super.hitTest(point, with: event)
if result != self.view {
return result

View File

@ -413,7 +413,7 @@ private final class MediaPlayerContext {
if let strongSelf = self {
if strongSelf.enableSound {
if strongSelf.continuePlayingWithoutSoundOnLostAudioSession {
strongSelf.continuePlayingWithoutSound()
strongSelf.continuePlayingWithoutSound(seek: .start)
} else {
strongSelf.pause(lostAudioSession: true, faded: false)
}
@ -492,7 +492,7 @@ private final class MediaPlayerContext {
if let strongSelf = self {
if strongSelf.enableSound {
if strongSelf.continuePlayingWithoutSoundOnLostAudioSession {
strongSelf.continuePlayingWithoutSound()
strongSelf.continuePlayingWithoutSound(seek: .start)
} else {
strongSelf.pause(lostAudioSession: true, faded: false)
}
@ -578,7 +578,7 @@ private final class MediaPlayerContext {
}
else if let loadedState = loadedState, case .none = seek {
timestamp = CMTimeGetSeconds(CMTimebaseGetTime(loadedState.controlTimebase.timebase))
if let duration = self.currentDuration() {
if let duration = self.currentDuration(), duration != 0.0 {
if timestamp > duration - 2.0 {
timestamp = 0.0
}
@ -622,7 +622,7 @@ private final class MediaPlayerContext {
}
}
fileprivate func continuePlayingWithoutSound() {
fileprivate func continuePlayingWithoutSound(seek: MediaPlayerSeek) {
if self.enableSound {
self.lastStatusUpdateTimestamp = nil
@ -647,10 +647,20 @@ private final class MediaPlayerContext {
self.enableSound = false
self.playAndRecord = false
var timestamp = CMTimeGetSeconds(CMTimebaseGetTime(loadedState.controlTimebase.timebase))
if let duration = self.currentDuration(), timestamp > duration - 2.0 {
var timestamp: Double
if case let .timecode(time) = seek {
timestamp = time
} else if case .none = seek {
timestamp = CMTimeGetSeconds(CMTimebaseGetTime(loadedState.controlTimebase.timebase))
if let duration = self.currentDuration(), duration != 0.0 {
if timestamp > duration - 2.0 {
timestamp = 0.0
}
}
} else {
timestamp = 0.0
}
self.seek(timestamp: timestamp, action: .play)
}
}
@ -1165,10 +1175,10 @@ public final class MediaPlayer {
}
}
public func continuePlayingWithoutSound() {
public func continuePlayingWithoutSound(seek: MediaPlayerSeek = .start) {
self.queue.async {
if let context = self.contextRef?.takeUnretainedValue() {
context.continuePlayingWithoutSound()
context.continuePlayingWithoutSound(seek: seek)
}
}
}

View File

@ -1354,10 +1354,8 @@ func debugRestoreState(basePath: String, name: String) {
}
}
private let sharedQueue = Queue(name: "org.telegram.postbox.Postbox")
public func openPostbox(basePath: String, seedConfiguration: SeedConfiguration, encryptionParameters: ValueBoxEncryptionParameters, timestampForAbsoluteTimeBasedOperations: Int32, isTemporary: Bool, isReadOnly: Bool, useCopy: Bool, useCaches: Bool, removeDatabaseOnError: Bool) -> Signal<PostboxResult, NoError> {
let queue = sharedQueue
let queue = Postbox.sharedQueue
return Signal { subscriber in
queue.async {
postboxLog("openPostbox, basePath: \(basePath), useCopy: \(useCopy)")
@ -4102,6 +4100,8 @@ final class PostboxImpl {
}
public class Postbox {
public static let sharedQueue = Queue(name: "org.telegram.postbox.Postbox")
let queue: Queue
private let impl: QueueLocalObject<PostboxImpl>

View File

@ -171,7 +171,8 @@ final class PendingStoryManager {
var storyObserverContexts: [Int32: Bag<(Float) -> Void>] = [:]
private let allStoriesUploadProgressPromise = ValuePromise<Float?>(nil, ignoreRepeated: true)
private let allStoriesUploadProgressPromise = Promise<Float?>(nil)
private var allStoriesUploadProgressValue: Float? = nil
var allStoriesUploadProgress: Signal<Float?, NoError> {
return self.allStoriesUploadProgressPromise.get()
}
@ -291,7 +292,29 @@ final class PendingStoryManager {
}
private func processContextsUpdated() {
self.allStoriesUploadProgressPromise.set(self.currentPendingItemContext?.progress)
let currentProgress = self.currentPendingItemContext?.progress
if self.allStoriesUploadProgressValue != currentProgress {
let previousProgress = self.allStoriesUploadProgressValue
self.allStoriesUploadProgressValue = currentProgress
if previousProgress != nil && currentProgress == nil {
// Hack: the UI is updated after 2 Postbox queries
let signal: Signal<Float?, NoError> = Signal { subscriber in
Postbox.sharedQueue.justDispatch {
Postbox.sharedQueue.justDispatch {
subscriber.putNext(nil)
}
}
return EmptyDisposable
}
|> deliverOnMainQueue
self.allStoriesUploadProgressPromise.set(signal)
} else {
self.allStoriesUploadProgressPromise.set(.single(currentProgress))
}
}
self.hasPendingPromise.set(self.currentPendingItemContext != nil)
}
}

View File

@ -551,11 +551,7 @@ public final class MessageInputPanelComponent: Component {
if component.attachmentAction != nil {
let attachmentButtonMode: MessageInputActionButtonComponent.Mode
if !self.textFieldExternalState.isEditing && component.moreAction != nil {
attachmentButtonMode = .more
} else {
attachmentButtonMode = .attach
}
let attachmentButtonSize = self.attachmentButton.update(
transition: transition,

View File

@ -1578,7 +1578,7 @@ public final class PeerInfoStoryPaneNode: ASDisplayNode, PeerInfoPaneNode, UIScr
totalCount = state.totalCount
totalCount = max(mappedItems.count, totalCount)
if totalCount == 0 && state.loadMoreToken != nil {
if totalCount == 0 && state.loadMoreToken != nil && !state.isCached {
totalCount = 100
}

View File

@ -12,15 +12,18 @@ public final class PlainButtonComponent: Component {
public let content: AnyComponent<Empty>
public let effectAlignment: EffectAlignment
public let minSize: CGSize?
public let action: () -> Void
public init(
content: AnyComponent<Empty>,
effectAlignment: EffectAlignment,
minSize: CGSize? = nil,
action: @escaping () -> Void
) {
self.content = content
self.effectAlignment = effectAlignment
self.minSize = minSize
self.action = action
}
@ -31,6 +34,9 @@ public final class PlainButtonComponent: Component {
if lhs.effectAlignment != rhs.effectAlignment {
return false
}
if lhs.minSize != rhs.minSize {
return false
}
return true
}
@ -122,7 +128,11 @@ public final class PlainButtonComponent: Component {
containerSize: availableSize
)
let size = contentSize
var size = contentSize
if let minSize = component.minSize {
size.width = max(size.width, minSize.width)
size.height = max(size.height, minSize.height)
}
if let contentView = self.content.view {
var contentTransition = transition

View File

@ -73,20 +73,20 @@ final class StoryAuthorInfoComponent: Component {
let titleSize = self.title.update(
transition: .immediate,
component: AnyComponent(Text(text: title, font: Font.semibold(17.0), color: .white)),
component: AnyComponent(Text(text: title, font: Font.medium(14.0), color: .white)),
environment: {},
containerSize: availableSize
)
let subtitleSize = self.subtitle.update(
transition: .immediate,
component: AnyComponent(Text(text: subtitle, font: Font.regular(12.0), color: UIColor(white: 1.0, alpha: 0.8))),
component: AnyComponent(Text(text: subtitle, font: Font.regular(11.0), color: UIColor(white: 1.0, alpha: 0.8))),
environment: {},
containerSize: availableSize
)
let contentHeight: CGFloat = titleSize.height + spacing + subtitleSize.height
let titleFrame = CGRect(origin: CGPoint(x: floor((availableSize.width - titleSize.width) * 0.5), y: floor((availableSize.height - contentHeight) * 0.5)), size: titleSize)
let subtitleFrame = CGRect(origin: CGPoint(x: floor((availableSize.width - subtitleSize.width) * 0.5), y: titleFrame.maxY + spacing), size: subtitleSize)
let titleFrame = CGRect(origin: CGPoint(x: 54.0, y: 2.0 + floor((availableSize.height - contentHeight) * 0.5)), size: titleSize)
let subtitleFrame = CGRect(origin: CGPoint(x: 54.0, y: titleFrame.maxY + spacing + UIScreenPixel), size: subtitleSize)
if let titleView = self.title.view {
if titleView.superview == nil {

View File

@ -48,7 +48,7 @@ final class StoryAvatarInfoComponent: Component {
self.component = component
self.state = state
let size = CGSize(width: 36.0, height: 36.0)
let size = CGSize(width: 32.0, height: 32.0)
self.avatarNode.frame = CGRect(origin: CGPoint(), size: size)
self.avatarNode.setPeer(

View File

@ -321,6 +321,8 @@ private final class StoryContainerScreenComponent: Component {
private func commitHorizontalPan(velocity: CGPoint) {
if var itemSetPanState = self.itemSetPanState {
var shouldDismiss = false
if let component = self.component, let stateValue = component.content.stateValue, let _ = stateValue.slice {
var direction: StoryContentContextNavigation.PeerDirection?
if abs(velocity.x) > 10.0 {
@ -345,6 +347,8 @@ private final class StoryContainerScreenComponent: Component {
}
self.itemSetPanState = itemSetPanState
self.state?.updated(transition: .immediate)
} else {
shouldDismiss = true
}
}
@ -365,6 +369,10 @@ private final class StoryContainerScreenComponent: Component {
component.content.resetSideStates()
}*/
})
if shouldDismiss {
self.environment?.controller()?.dismiss()
}
}
}
@ -895,6 +903,31 @@ private final class StoryContainerScreenComponent: Component {
},
controller: { [weak self] in
return self?.environment?.controller()
},
toggleAmbientMode: { [weak self] in
guard let self else {
return
}
if self.storyItemSharedState.useAmbientMode {
self.storyItemSharedState.useAmbientMode = false
self.volumeButtonsListenerShouldBeActive.set(false)
for (_, itemSetView) in self.visibleItemSetViews {
if let componentView = itemSetView.view.view as? StoryItemSetContainerComponent.View {
componentView.leaveAmbientMode()
}
}
} else {
self.storyItemSharedState.useAmbientMode = true
self.volumeButtonsListenerShouldBeActive.set(true)
for (_, itemSetView) in self.visibleItemSetViews {
if let componentView = itemSetView.view.view as? StoryItemSetContainerComponent.View {
componentView.enterAmbientMode()
}
}
}
}
)),
environment: {},

View File

@ -30,6 +30,9 @@ public final class StoryContentItem: Equatable {
open func leaveAmbientMode() {
}
open func enterAmbientMode() {
}
open var videoPlaybackPosition: Double? {
return nil
}

View File

@ -207,10 +207,17 @@ final class StoryItemContentComponent: Component {
override func leaveAmbientMode() {
if let videoNode = self.videoNode {
videoNode.setSoundEnabled(true)
videoNode.continueWithOverridingAmbientMode()
}
}
override func enterAmbientMode() {
if let videoNode = self.videoNode {
videoNode.setSoundEnabled(false)
}
}
private func updateIsProgressPaused(update: Bool) {
if let videoNode = self.videoNode {
var canPlay = !self.isProgressPaused && self.contentLoaded && self.hierarchyTrackingLayer.isInHierarchy

View File

@ -49,6 +49,7 @@ final class StoryItemSetContainerSendMessage {
weak var attachmentController: AttachmentController?
weak var shareController: ShareController?
weak var tooltipScreen: ViewController?
weak var actionSheet: ViewController?
var currentInputMode: InputMode = .text
private var needsInputActivation = false
@ -640,6 +641,40 @@ final class StoryItemSetContainerSendMessage {
return
}
if focusedItem.storyItem.isForwardingDisabled {
let presentationData = component.context.sharedContext.currentPresentationData.with({ $0 }).withUpdated(theme: component.theme)
let actionSheet = ActionSheetController(presentationData: presentationData)
actionSheet.setItemGroups([
ActionSheetItemGroup(items: [
ActionSheetButtonItem(title: "Copy Link", color: .accent, action: { [weak self, weak view, weak actionSheet] in
actionSheet?.dismissAnimated()
guard let self, let view else {
return
}
self.performCopyLinkAction(view: view)
})
]),
ActionSheetItemGroup(items: [
ActionSheetButtonItem(title: presentationData.strings.Common_Cancel, color: .accent, font: .bold, action: { [weak actionSheet] in
actionSheet?.dismissAnimated()
})
])
])
actionSheet.dismissed = { [weak self, weak view] _ in
guard let self, let view else {
return
}
self.actionSheet = nil
view.updateIsProgressPaused()
}
self.actionSheet = actionSheet
view.updateIsProgressPaused()
component.presentController(actionSheet, nil)
} else {
var preferredAction: ShareControllerPreferredAction?
if focusedItem.storyItem.isPublic {
preferredAction = .custom(action: ShareControllerAction(title: "Copy Link", action: {
@ -738,6 +773,32 @@ final class StoryItemSetContainerSendMessage {
controller.present(shareController, in: .window(.root))
}
}
func performCopyLinkAction(view: StoryItemSetContainerComponent.View) {
guard let component = view.component else {
return
}
let _ = (component.context.engine.messages.exportStoryLink(peerId: component.slice.peer.id, id: component.slice.item.storyItem.id)
|> deliverOnMainQueue).start(next: { [weak view] link in
guard let view, let component = view.component else {
return
}
if let link {
UIPasteboard.general.string = link
let presentationData = component.context.sharedContext.currentPresentationData.with({ $0 }).withUpdated(theme: component.theme)
component.presentController(UndoOverlayController(
presentationData: presentationData,
content: .linkCopied(text: "Link copied."),
elevatedLayout: false,
animateInAsReplacement: false,
action: { _ in return false }
), nil)
}
})
}
private func clearInputText(view: StoryItemSetContainerComponent.View) {
guard let inputPanelView = view.inputPanel.view as? MessageInputPanelComponent.View else {

View File

@ -53,7 +53,6 @@ public final class StoryFooterPanelComponent: Component {
private let viewStatsText = ComponentView<Empty>()
private let viewStatsExpandedText = ComponentView<Empty>()
private let deleteButton = ComponentView<Empty>()
private var moreButton: MoreHeaderButton?
private var statusButton: HighlightableButton?
private var statusNode: SemanticStatusNode?
@ -322,41 +321,6 @@ public final class StoryFooterPanelComponent: Component {
transition.setAlpha(view: deleteButtonView, alpha: pow(1.0 - component.expandFraction, 1.0) * baseViewCountAlpha)
}
let moreButton: MoreHeaderButton
if let current = self.moreButton {
moreButton = current
} else {
if let moreButton = self.moreButton {
moreButton.removeFromSupernode()
self.moreButton = nil
}
moreButton = MoreHeaderButton(color: .white)
moreButton.isUserInteractionEnabled = true
moreButton.setContent(.more(MoreHeaderButton.optionsCircleImage(color: .white)))
moreButton.onPressed = { [weak self] in
guard let self, let component = self.component, let moreButton = self.moreButton else {
return
}
moreButton.play()
component.moreAction(moreButton.view, nil)
}
moreButton.contextAction = { [weak self] sourceNode, gesture in
guard let self, let component = self.component, let moreButton = self.moreButton else {
return
}
moreButton.play()
component.moreAction(moreButton.view, gesture)
}
self.moreButton = moreButton
self.addSubnode(moreButton)
}
let buttonSize = CGSize(width: 32.0, height: 44.0)
moreButton.setContent(.more(MoreHeaderButton.optionsCircleImage(color: .white)))
transition.setFrame(view: moreButton.view, frame: CGRect(origin: CGPoint(x: rightContentOffset - buttonSize.width, y: floor((size.height - buttonSize.height) / 2.0)), size: buttonSize))
transition.setAlpha(view: moreButton.view, alpha: pow(1.0 - component.expandFraction, 1.0) * baseViewCountAlpha)
return size
}
}

View File

@ -541,7 +541,9 @@ public final class StoryPeerListComponent: Component {
if component.useHiddenList {
collapseStartIndex = 0
} else if let storySubscriptions = component.storySubscriptions {
if let accountItem = storySubscriptions.accountItem, (accountItem.hasUnseen || accountItem.hasPending) {
if self.sortedItems.count < 3, let accountItem = storySubscriptions.accountItem, accountItem.storyCount != 0 {
collapseStartIndex = 1
} else if let accountItem = storySubscriptions.accountItem, (accountItem.hasUnseen || accountItem.hasPending) {
collapseStartIndex = 0
} else {
collapseStartIndex = 1

View File

@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "StoryClose.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,4 @@
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7 7L23 23" stroke="white" stroke-width="1.66" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M7 23L23 7" stroke="white" stroke-width="1.66" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 313 B

View File

@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "StorySoundOff2.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,3 @@
<svg width="25" height="20" viewBox="0 0 25 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.0215 1.74537C11.9928 1.76196 11.9262 1.80388 11.8112 1.9001C11.5861 2.08859 11.2955 2.37806 10.8555 2.81805L7.51582 6.15775L7.48882 6.1848C7.38313 6.29082 7.2639 6.41043 7.1236 6.50704C6.91149 6.65308 6.67096 6.75271 6.41771 6.79942C6.25019 6.83032 6.08131 6.83006 5.93161 6.82982H5.9316L5.89338 6.82978H5.49998C4.51658 6.82978 4.18769 6.83691 3.93835 6.90372C3.1895 7.10438 2.60458 7.68929 2.40393 8.43814C2.33711 8.68749 2.32998 9.01637 2.32998 9.99978C2.32998 10.9832 2.33711 11.3121 2.40393 11.5614C2.60458 12.3103 3.1895 12.8952 3.93835 13.0958C4.18769 13.1627 4.51658 13.1698 5.49998 13.1698H5.89338L5.93159 13.1697C6.0813 13.1695 6.25018 13.1692 6.41771 13.2001C6.67096 13.2468 6.91149 13.3465 7.1236 13.4925C7.26389 13.5891 7.38311 13.7087 7.4888 13.8147L7.48881 13.8147L7.48882 13.8148L7.51582 13.8418L10.8555 17.1815C11.2955 17.6215 11.5861 17.911 11.8112 18.0995C11.9262 18.1957 11.9928 18.2376 12.0215 18.2542C12.0516 18.2504 12.08 18.2386 12.104 18.2201C12.1125 18.188 12.13 18.1112 12.1433 17.9619C12.1692 17.6694 12.17 17.2593 12.17 16.637V3.36252C12.17 2.74028 12.1692 2.33012 12.1433 2.03763C12.13 1.88834 12.1125 1.81154 12.104 1.77951C12.08 1.761 12.0516 1.7492 12.0215 1.74537ZM11.8564 0.0896356C12.4404 0.0436749 13.0111 0.280065 13.3915 0.725504C13.6934 1.07892 13.7652 1.53495 13.7968 1.89111C13.83 2.266 13.83 2.75092 13.83 3.32317V3.32321V3.36252V16.637V16.6764V16.6764C13.83 17.2486 13.83 17.7336 13.7968 18.1085C13.7652 18.4646 13.6934 18.9206 13.3915 19.2741C13.0111 19.7195 12.4404 19.9559 11.8564 19.9099C11.3931 19.8735 11.0198 19.6018 10.7456 19.3723C10.457 19.1307 10.1141 18.7878 9.70949 18.3831L9.68171 18.3553L6.34202 15.0156C6.27117 14.9448 6.23288 14.9066 6.20321 14.879C6.19006 14.8667 6.18292 14.8607 6.18011 14.8584C6.16161 14.846 6.14087 14.8374 6.11905 14.8331C6.11543 14.8327 6.10609 14.832 6.08813 14.8313C6.04761 14.8299 5.99358 14.8298 5.89338 14.8298H5.49998L5.37661 14.8298C4.5664 14.8301 3.9979 14.8304 3.50871 14.6993C2.18701 14.3451 1.15464 13.3128 0.800489 11.9911C0.66941 11.5019 0.669634 10.9334 0.669953 10.1232L0.669985 9.99978L0.669953 9.8764C0.669634 9.06619 0.66941 8.49769 0.800489 8.0085C1.15464 6.6868 2.18701 5.65443 3.50871 5.30028C3.9979 5.16921 4.56639 5.16943 5.3766 5.16975L5.49998 5.16978H5.89338C5.99358 5.16978 6.04762 5.16966 6.08813 5.16823C6.10609 5.16759 6.11544 5.16684 6.11906 5.16649C6.14087 5.16214 6.16161 5.15354 6.18012 5.1412C6.18293 5.13889 6.19006 5.13281 6.20321 5.12056C6.23288 5.09292 6.27117 5.0548 6.34202 4.98395L9.68171 1.64426L9.70949 1.61647C10.1141 1.2118 10.457 0.868883 10.7456 0.627275C11.0198 0.397752 11.3931 0.126102 11.8564 0.0896356ZM24.4702 6.52955C24.2105 6.26986 23.7895 6.26986 23.5298 6.52955L21 9.05933L18.4702 6.52955C18.2105 6.26986 17.7895 6.26986 17.5298 6.52955C17.2701 6.78925 17.2701 7.21031 17.5298 7.47001L20.0595 9.99978L17.5298 12.5296C17.2701 12.7893 17.2701 13.2103 17.5298 13.47C17.7895 13.7297 18.2105 13.7297 18.4702 13.47L21 10.9402L23.5298 13.47C23.7895 13.7297 24.2105 13.7297 24.4702 13.47C24.7299 13.2103 24.7299 12.7893 24.4702 12.5296L21.9404 9.99978L24.4702 7.47001C24.7299 7.21031 24.7299 6.78925 24.4702 6.52955Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "StorySoundOn.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,3 @@
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.0215 6.74537C13.9928 6.76196 13.9262 6.80388 13.8112 6.9001C13.5861 7.08859 13.2955 7.37806 12.8555 7.81805L9.51582 11.1577L9.48882 11.1848C9.38313 11.2908 9.2639 11.4104 9.1236 11.507C8.91149 11.6531 8.67096 11.7527 8.41771 11.7994C8.25019 11.8303 8.08131 11.8301 7.93161 11.8298H7.9316L7.89338 11.8298H7.49998C6.51658 11.8298 6.18769 11.8369 5.93835 11.9037C5.1895 12.1044 4.60458 12.6893 4.40393 13.4381C4.33711 13.6875 4.32998 14.0164 4.32998 14.9998C4.32998 15.9832 4.33711 16.3121 4.40393 16.5614C4.60458 17.3103 5.1895 17.8952 5.93835 18.0958C6.18769 18.1627 6.51658 18.1698 7.49998 18.1698H7.89338L7.93159 18.1697C8.0813 18.1695 8.25018 18.1692 8.41771 18.2001C8.67096 18.2468 8.91149 18.3465 9.1236 18.4925C9.2639 18.5891 9.38312 18.7087 9.48881 18.8148L9.48882 18.8148L9.51582 18.8418L12.8555 22.1815C13.2955 22.6215 13.5861 22.911 13.8112 23.0995C13.9262 23.1957 13.9928 23.2376 14.0215 23.2542C14.0516 23.2504 14.08 23.2386 14.104 23.2201C14.1125 23.188 14.13 23.1112 14.1433 22.9619C14.1692 22.6694 14.17 22.2593 14.17 21.637V8.36252C14.17 7.74028 14.1692 7.33012 14.1433 7.03763C14.13 6.88834 14.1125 6.81154 14.104 6.77951C14.08 6.761 14.0516 6.7492 14.0215 6.74537ZM13.8564 5.08964C14.4404 5.04367 15.0111 5.28006 15.3915 5.7255C15.6934 6.07892 15.7652 6.53495 15.7968 6.89111C15.83 7.266 15.83 7.75092 15.83 8.32317V8.32321V8.36252V21.637V21.6764V21.6764C15.83 22.2486 15.83 22.7336 15.7968 23.1085C15.7652 23.4646 15.6934 23.9206 15.3915 24.2741C15.0111 24.7195 14.4404 24.9559 13.8564 24.9099C13.3931 24.8735 13.0198 24.6018 12.7456 24.3723C12.457 24.1307 12.1141 23.7878 11.7095 23.3831L11.6817 23.3553L8.34202 20.0156C8.27117 19.9448 8.23288 19.9066 8.20321 19.879C8.19006 19.8667 8.18292 19.8607 8.18011 19.8584C8.16161 19.846 8.14087 19.8374 8.11905 19.8331C8.11543 19.8327 8.10609 19.832 8.08813 19.8313C8.04761 19.8299 7.99358 19.8298 7.89338 19.8298H7.49998L7.37661 19.8298C6.5664 19.8301 5.9979 19.8304 5.50871 19.6993C4.18701 19.3451 3.15464 18.3128 2.80049 16.9911C2.66941 16.5019 2.66963 15.9334 2.66995 15.1232L2.66998 14.9998L2.66995 14.8764C2.66963 14.0662 2.66941 13.4977 2.80049 13.0085C3.15464 11.6868 4.18701 10.6544 5.50871 10.3003C5.9979 10.1692 6.56639 10.1694 7.3766 10.1697L7.49998 10.1698H7.89338C7.99358 10.1698 8.04762 10.1697 8.08813 10.1682C8.10609 10.1676 8.11544 10.1668 8.11906 10.1665C8.14087 10.1621 8.16161 10.1535 8.18012 10.1412C8.18293 10.1389 8.19006 10.1328 8.20321 10.1206C8.23288 10.0929 8.27117 10.0548 8.34202 9.98395L11.6817 6.64426L11.7095 6.61647C12.1141 6.2118 12.457 5.86888 12.7456 5.62727C13.0198 5.39775 13.3931 5.1261 13.8564 5.08964ZM19.3298 9.91991C19.7006 9.65047 20.2197 9.73268 20.4891 10.1035C21.5231 11.5267 22.08 13.2407 22.08 14.9998C22.08 16.7589 21.5231 18.4729 20.4891 19.896C20.2197 20.2669 19.7006 20.3491 19.3298 20.0797C18.9589 19.8102 18.8767 19.2912 19.1461 18.9203C19.9741 17.7808 20.42 16.4083 20.42 14.9998C20.42 13.5912 19.9741 12.2188 19.1461 11.0793C18.8767 10.7084 18.9589 10.1893 19.3298 9.91991ZM24.5342 7.16461C24.2647 6.79376 23.7457 6.71155 23.3748 6.98098C23.004 7.25042 22.9218 7.76948 23.1912 8.14033C24.6398 10.1341 25.42 12.5353 25.42 14.9998C25.42 17.4642 24.6398 19.8654 23.1912 21.8592C22.9218 22.2301 23.004 22.7491 23.3748 23.0186C23.7457 23.288 24.2647 23.2058 24.5342 22.835C26.1888 20.5576 27.08 17.8148 27.08 14.9998C27.08 12.1848 26.1888 9.44201 24.5342 7.16461Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -401,9 +401,9 @@ private final class NativeVideoContentNode: ASDisplayNode, UniversalVideoContent
func setSoundEnabled(_ value: Bool) {
assert(Queue.mainQueue().isCurrent())
if value {
self.player.playOnceWithSound(playAndRecord: true)
self.player.playOnceWithSound(playAndRecord: true, seek: .none)
} else {
self.player.continuePlayingWithoutSound()
self.player.continuePlayingWithoutSound(seek: .none)
}
}