mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix video playback in iOS < 17.5
(cherry picked from commit 5c5236ce4cebc3ee47218f69f8be422d7c04a5d9)
This commit is contained in:
parent
67ed6f9b8e
commit
af8276cf2d
@ -342,7 +342,7 @@ private final class MediaPlayerContext {
|
||||
let _ = self.playerStatusValue.swap(status)
|
||||
}
|
||||
|
||||
let frameSource = FFMpegMediaFrameSource(queue: self.queue, postbox: self.postbox, userLocation: self.userLocation, userContentType: self.userContentType, resourceReference: self.resourceReference, tempFilePath: self.tempFilePath, limitedFileRange: self.limitedFileRange, streamable: self.streamable.enabled, isSeekable: self.streamable.isSeekable, video: self.video, preferSoftwareDecoding: self.preferSoftwareDecoding, fetchAutomatically: self.fetchAutomatically, stallDuration: self.streamable.parameters.0, lowWaterDuration: self.streamable.parameters.1, highWaterDuration: self.streamable.parameters.2, storeAfterDownload: self.storeAfterDownload)
|
||||
let frameSource = FFMpegMediaFrameSource(queue: self.queue, postbox: self.postbox, userLocation: self.userLocation, userContentType: self.userContentType, resourceReference: self.resourceReference, tempFilePath: self.tempFilePath, limitedFileRange: self.limitedFileRange, streamable: self.streamable.enabled, isSeekable: self.streamable.isSeekable, video: self.video, preferSoftwareDecoding: self.preferSoftwareDecoding, fetchAutomatically: self.fetchAutomatically, stallDuration: self.streamable.parameters.0, lowWaterDuration: self.streamable.parameters.1, highWaterDuration: self.streamable.parameters.2, storeAfterDownload: self.storeAfterDownload, isAudioVideoMessage: self.isAudioVideoMessage)
|
||||
let disposable = MetaDisposable()
|
||||
let updatedSeekState: MediaPlayerSeekState?
|
||||
if let loadedDuration = loadedDuration {
|
||||
|
@ -221,7 +221,10 @@ public final class MediaPlayerNode: ASDisplayNode {
|
||||
videoLayer.enqueue(frame.sampleBuffer)
|
||||
if #available(iOS 17.4, *) {
|
||||
} else {
|
||||
strongSelf.hasSentFramesToDisplay?()
|
||||
if !strongSelf.didNotifyVideoLayerReadyForDisplay {
|
||||
strongSelf.didNotifyVideoLayerReadyForDisplay = true
|
||||
strongSelf.hasSentFramesToDisplay?()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -257,7 +260,10 @@ public final class MediaPlayerNode: ASDisplayNode {
|
||||
return
|
||||
}
|
||||
videoLayer.enqueue(frame.sampleBuffer)
|
||||
//strongSelf.hasSentFramesToDisplay?()
|
||||
if !strongSelf.didNotifyVideoLayerReadyForDisplay {
|
||||
strongSelf.didNotifyVideoLayerReadyForDisplay = true
|
||||
strongSelf.hasSentFramesToDisplay?()
|
||||
}
|
||||
}
|
||||
|
||||
Queue.mainQueue().async {
|
||||
|
Loading…
x
Reference in New Issue
Block a user