mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Video message recording improvements
This commit is contained in:
@@ -39,6 +39,7 @@ import VolumeSliderContextItem
|
||||
import TelegramStringFormatting
|
||||
import ForwardInfoPanelComponent
|
||||
import ContextReferenceButtonComponent
|
||||
import MediaScrubberComponent
|
||||
|
||||
private let playbackButtonTag = GenericComponentViewTag()
|
||||
private let muteButtonTag = GenericComponentViewTag()
|
||||
@@ -1359,6 +1360,7 @@ final class MediaEditorScreenComponent: Component {
|
||||
transition: scrubberTransition,
|
||||
component: AnyComponent(MediaScrubberComponent(
|
||||
context: component.context,
|
||||
style: .editor,
|
||||
generationTimestamp: playerState.generationTimestamp,
|
||||
position: playerState.position,
|
||||
minDuration: minDuration,
|
||||
@@ -6081,3 +6083,23 @@ private func setupButtonShadow(_ view: UIView, radius: CGFloat = 2.0) {
|
||||
view.layer.shadowColor = UIColor.black.cgColor
|
||||
view.layer.shadowOpacity = 0.35
|
||||
}
|
||||
|
||||
extension MediaScrubberComponent.Track {
|
||||
public init(_ track: MediaEditorPlayerState.Track) {
|
||||
let content: MediaScrubberComponent.Track.Content
|
||||
switch track.content {
|
||||
case let .video(frames, framesUpdateTimestamp):
|
||||
content = .video(frames: frames, framesUpdateTimestamp: framesUpdateTimestamp)
|
||||
case let .audio(artist, title, samples, peak):
|
||||
content = .audio(artist: artist, title: title, samples: samples, peak: peak)
|
||||
}
|
||||
self.init(
|
||||
id: track.id,
|
||||
content: content,
|
||||
duration: track.duration,
|
||||
trimRange: track.trimRange,
|
||||
offset: track.offset,
|
||||
isMain: track.isMain
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user