mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Video streaming improvements
This commit is contained in:
parent
9f4775835f
commit
1e16f0a4cc
@ -355,12 +355,18 @@ public final class GroupCallNavigationAccessoryPanel: ASDisplayNode {
|
|||||||
let membersText: String
|
let membersText: String
|
||||||
if data.participantCount == 0 {
|
if data.participantCount == 0 {
|
||||||
membersText = self.strings.VoiceChat_Panel_TapToJoin
|
membersText = self.strings.VoiceChat_Panel_TapToJoin
|
||||||
|
} else if let groupCall = data.groupCall, groupCall.isStream {
|
||||||
|
membersText = self.strings.LiveStream_ViewerCount(Int32(data.participantCount))
|
||||||
} else {
|
} else {
|
||||||
membersText = self.strings.VoiceChat_Panel_Members(Int32(data.participantCount))
|
membersText = self.strings.VoiceChat_Panel_Members(Int32(data.participantCount))
|
||||||
}
|
}
|
||||||
self.currentText = membersText
|
self.currentText = membersText
|
||||||
|
|
||||||
|
if data.info.isStream {
|
||||||
|
self.avatarsContent = self.avatarsContext.update(peers: [], animated: false)
|
||||||
|
} else {
|
||||||
self.avatarsContent = self.avatarsContext.update(peers: data.topParticipants.map { EnginePeer($0.peer) }, animated: false)
|
self.avatarsContent = self.avatarsContext.update(peers: data.topParticipants.map { EnginePeer($0.peer) }, animated: false)
|
||||||
|
}
|
||||||
|
|
||||||
self.textNode.attributedText = NSAttributedString(string: membersText, font: Font.regular(13.0), textColor: self.theme.chat.inputPanel.secondaryTextColor)
|
self.textNode.attributedText = NSAttributedString(string: membersText, font: Font.regular(13.0), textColor: self.theme.chat.inputPanel.secondaryTextColor)
|
||||||
|
|
||||||
@ -386,7 +392,11 @@ public final class GroupCallNavigationAccessoryPanel: ASDisplayNode {
|
|||||||
}
|
}
|
||||||
strongSelf.currentText = membersText
|
strongSelf.currentText = membersText
|
||||||
|
|
||||||
|
if let info = summaryState.info, info.isStream {
|
||||||
|
strongSelf.avatarsContent = strongSelf.avatarsContext.update(peers: [], animated: false)
|
||||||
|
} else {
|
||||||
strongSelf.avatarsContent = strongSelf.avatarsContext.update(peers: summaryState.topParticipants.map { EnginePeer($0.peer) }, animated: false)
|
strongSelf.avatarsContent = strongSelf.avatarsContext.update(peers: summaryState.topParticipants.map { EnginePeer($0.peer) }, animated: false)
|
||||||
|
}
|
||||||
|
|
||||||
if let (size, leftInset, rightInset) = strongSelf.validLayout {
|
if let (size, leftInset, rightInset) = strongSelf.validLayout {
|
||||||
strongSelf.updateLayout(size: size, leftInset: leftInset, rightInset: rightInset, transition: .immediate)
|
strongSelf.updateLayout(size: size, leftInset: leftInset, rightInset: rightInset, transition: .immediate)
|
||||||
@ -458,12 +468,18 @@ public final class GroupCallNavigationAccessoryPanel: ASDisplayNode {
|
|||||||
let membersText: String
|
let membersText: String
|
||||||
if data.participantCount == 0 {
|
if data.participantCount == 0 {
|
||||||
membersText = self.strings.VoiceChat_Panel_TapToJoin
|
membersText = self.strings.VoiceChat_Panel_TapToJoin
|
||||||
|
} else if data.info.isStream {
|
||||||
|
membersText = self.strings.LiveStream_ViewerCount(Int32(data.participantCount))
|
||||||
} else {
|
} else {
|
||||||
membersText = self.strings.VoiceChat_Panel_Members(Int32(data.participantCount))
|
membersText = self.strings.VoiceChat_Panel_Members(Int32(data.participantCount))
|
||||||
}
|
}
|
||||||
self.currentText = membersText
|
self.currentText = membersText
|
||||||
|
|
||||||
|
if data.info.isStream {
|
||||||
|
self.avatarsContent = self.avatarsContext.update(peers: [], animated: false)
|
||||||
|
} else {
|
||||||
self.avatarsContent = self.avatarsContext.update(peers: data.topParticipants.map { EnginePeer($0.peer) }, animated: false)
|
self.avatarsContent = self.avatarsContext.update(peers: data.topParticipants.map { EnginePeer($0.peer) }, animated: false)
|
||||||
|
}
|
||||||
|
|
||||||
updateAudioLevels = true
|
updateAudioLevels = true
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ public final class VoiceChatJoinScreen: ViewController {
|
|||||||
strongSelf.dismiss()
|
strongSelf.dismiss()
|
||||||
strongSelf.join(activeCall)
|
strongSelf.join(activeCall)
|
||||||
} else {
|
} else {
|
||||||
strongSelf.controllerNode.setPeer(call: activeCall, peer: peer, title: call.info.title, memberCount: call.info.participantCount)
|
strongSelf.controllerNode.setPeer(call: activeCall, peer: peer, title: call.info.title, memberCount: call.info.participantCount, isStream: call.info.isStream)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
||||||
@ -632,7 +632,7 @@ public final class VoiceChatJoinScreen: ViewController {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
func setPeer(call: CachedChannelData.ActiveCall, peer: Peer, title: String?, memberCount: Int) {
|
func setPeer(call: CachedChannelData.ActiveCall, peer: Peer, title: String?, memberCount: Int, isStream: Bool) {
|
||||||
self.call = call
|
self.call = call
|
||||||
|
|
||||||
let transition = ContainedViewLayoutTransition.animated(duration: 0.22, curve: .easeInOut)
|
let transition = ContainedViewLayoutTransition.animated(duration: 0.22, curve: .easeInOut)
|
||||||
@ -643,7 +643,7 @@ public final class VoiceChatJoinScreen: ViewController {
|
|||||||
self.actionButtonNode.isEnabled = true
|
self.actionButtonNode.isEnabled = true
|
||||||
self.actionButtonNode.setTitle(self.asSpeaker ? self.presentationData.strings.Invitation_JoinVoiceChatAsSpeaker : self.presentationData.strings.Invitation_JoinVoiceChatAsListener, with: Font.medium(20.0), with: self.presentationData.theme.actionSheet.standardActionTextColor, for: .normal)
|
self.actionButtonNode.setTitle(self.asSpeaker ? self.presentationData.strings.Invitation_JoinVoiceChatAsSpeaker : self.presentationData.strings.Invitation_JoinVoiceChatAsListener, with: Font.medium(20.0), with: self.presentationData.theme.actionSheet.standardActionTextColor, for: .normal)
|
||||||
|
|
||||||
self.transitionToContentNode(VoiceChatPreviewContentNode(context: self.context, peer: peer, title: title, memberCount: memberCount, theme: self.presentationData.theme, strings: self.presentationData.strings, displayOrder: self.presentationData.nameDisplayOrder))
|
self.transitionToContentNode(VoiceChatPreviewContentNode(context: self.context, peer: peer, title: title, memberCount: memberCount, isStream: isStream, theme: self.presentationData.theme, strings: self.presentationData.strings, displayOrder: self.presentationData.nameDisplayOrder))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -657,7 +657,7 @@ final class VoiceChatPreviewContentNode: ASDisplayNode, ShareContentContainerNod
|
|||||||
private let titleNode: ImmediateTextNode
|
private let titleNode: ImmediateTextNode
|
||||||
private let countNode: ImmediateTextNode
|
private let countNode: ImmediateTextNode
|
||||||
|
|
||||||
init(context: AccountContext, peer: Peer, title: String?, memberCount: Int, theme: PresentationTheme, strings: PresentationStrings, displayOrder: PresentationPersonNameOrder) {
|
init(context: AccountContext, peer: Peer, title: String?, memberCount: Int, isStream: Bool, theme: PresentationTheme, strings: PresentationStrings, displayOrder: PresentationPersonNameOrder) {
|
||||||
self.avatarNode = AvatarNode(font: avatarFont)
|
self.avatarNode = AvatarNode(font: avatarFont)
|
||||||
self.titleNode = ImmediateTextNode()
|
self.titleNode = ImmediateTextNode()
|
||||||
self.titleNode.maximumNumberOfLines = 4
|
self.titleNode.maximumNumberOfLines = 4
|
||||||
@ -677,7 +677,13 @@ final class VoiceChatPreviewContentNode: ASDisplayNode, ShareContentContainerNod
|
|||||||
self.addSubnode(self.countNode)
|
self.addSubnode(self.countNode)
|
||||||
|
|
||||||
self.countNode.isHidden = memberCount == 0
|
self.countNode.isHidden = memberCount == 0
|
||||||
self.countNode.attributedText = NSAttributedString(string: memberCount == 0 ? "" : strings.VoiceChat_Panel_Members(Int32(memberCount)), font: Font.regular(16.0), textColor: theme.actionSheet.secondaryTextColor)
|
let text: String
|
||||||
|
if isStream {
|
||||||
|
text = memberCount == 0 ? "" : strings.LiveStream_ViewerCount(Int32(memberCount))
|
||||||
|
} else {
|
||||||
|
text = memberCount == 0 ? "" : strings.VoiceChat_Panel_Members(Int32(memberCount))
|
||||||
|
}
|
||||||
|
self.countNode.attributedText = NSAttributedString(string: text, font: Font.regular(16.0), textColor: theme.actionSheet.secondaryTextColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
func activate() {
|
func activate() {
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 5dfa5925449e5279ba7e1b0a401b0678dea86dcc
|
Subproject commit a5da9369d138bbcf6d435808fd599a59cedabe4c
|
Loading…
x
Reference in New Issue
Block a user