mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Don't loop secret videos
This commit is contained in:
@@ -37,6 +37,7 @@ public class UniversalVideoGalleryItem: GalleryItem {
|
||||
let displayInfoOnTop: Bool
|
||||
let hideControls: Bool
|
||||
let fromPlayingVideo: Bool
|
||||
let isSecret: Bool
|
||||
let landscape: Bool
|
||||
let timecode: Double?
|
||||
let configuration: GalleryConfiguration?
|
||||
@@ -46,7 +47,7 @@ public class UniversalVideoGalleryItem: GalleryItem {
|
||||
let storeMediaPlaybackState: (MessageId, Double?) -> Void
|
||||
let present: (ViewController, Any?) -> Void
|
||||
|
||||
public init(context: AccountContext, presentationData: PresentationData, content: UniversalVideoContent, originData: GalleryItemOriginData?, indexData: GalleryItemIndexData?, contentInfo: UniversalVideoGalleryItemContentInfo?, caption: NSAttributedString, credit: NSAttributedString? = nil, displayInfoOnTop: Bool = false, hideControls: Bool = false, fromPlayingVideo: Bool = false, landscape: Bool = false, timecode: Double? = nil, configuration: GalleryConfiguration? = nil, playbackCompleted: @escaping () -> Void = {}, performAction: @escaping (GalleryControllerInteractionTapAction) -> Void, openActionOptions: @escaping (GalleryControllerInteractionTapAction) -> Void, storeMediaPlaybackState: @escaping (MessageId, Double?) -> Void, present: @escaping (ViewController, Any?) -> Void) {
|
||||
public init(context: AccountContext, presentationData: PresentationData, content: UniversalVideoContent, originData: GalleryItemOriginData?, indexData: GalleryItemIndexData?, contentInfo: UniversalVideoGalleryItemContentInfo?, caption: NSAttributedString, credit: NSAttributedString? = nil, displayInfoOnTop: Bool = false, hideControls: Bool = false, fromPlayingVideo: Bool = false, isSecret: Bool = false, landscape: Bool = false, timecode: Double? = nil, configuration: GalleryConfiguration? = nil, playbackCompleted: @escaping () -> Void = {}, performAction: @escaping (GalleryControllerInteractionTapAction) -> Void, openActionOptions: @escaping (GalleryControllerInteractionTapAction) -> Void, storeMediaPlaybackState: @escaping (MessageId, Double?) -> Void, present: @escaping (ViewController, Any?) -> Void) {
|
||||
self.context = context
|
||||
self.presentationData = presentationData
|
||||
self.content = content
|
||||
@@ -58,6 +59,7 @@ public class UniversalVideoGalleryItem: GalleryItem {
|
||||
self.displayInfoOnTop = displayInfoOnTop
|
||||
self.hideControls = hideControls
|
||||
self.fromPlayingVideo = fromPlayingVideo
|
||||
self.isSecret = isSecret
|
||||
self.landscape = landscape
|
||||
self.timecode = timecode
|
||||
self.configuration = configuration
|
||||
@@ -1024,7 +1026,7 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
|
||||
|
||||
private var actionAtEnd: MediaPlayerPlayOnceWithSoundActionAtEnd {
|
||||
if let item = self.item {
|
||||
if let content = item.content as? NativeVideoContent, content.duration <= 30 {
|
||||
if !item.isSecret, let content = item.content as? NativeVideoContent, content.duration <= 30 {
|
||||
return .loop
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user