[WIP] Dynamic video streaming

This commit is contained in:
Isaac
2024-09-18 01:04:29 +08:00
parent 7cbb5c784d
commit 923587b0da
141 changed files with 3365 additions and 1995 deletions

View File

@@ -22,7 +22,8 @@ private func generateStarsReactionFile(kind: Int, isAnimatedSticker: Bool) -> Te
immediateThumbnailData: nil,
mimeType: isAnimatedSticker ? "application/x-tgsticker" : "image/webp",
size: nil,
attributes: attributes
attributes: attributes,
alternativeRepresentations: []
)
}
@@ -261,23 +262,23 @@ private extension AvailableReactions.Reaction {
convenience init?(apiReaction: Api.AvailableReaction) {
switch apiReaction {
case let .availableReaction(flags, reaction, title, staticIcon, appearAnimation, selectAnimation, activateAnimation, effectAnimation, aroundAnimation, centerIcon):
guard let staticIconFile = telegramMediaFileFromApiDocument(staticIcon) else {
guard let staticIconFile = telegramMediaFileFromApiDocument(staticIcon, altDocuments: []) else {
return nil
}
guard let appearAnimationFile = telegramMediaFileFromApiDocument(appearAnimation) else {
guard let appearAnimationFile = telegramMediaFileFromApiDocument(appearAnimation, altDocuments: []) else {
return nil
}
guard let selectAnimationFile = telegramMediaFileFromApiDocument(selectAnimation) else {
guard let selectAnimationFile = telegramMediaFileFromApiDocument(selectAnimation, altDocuments: []) else {
return nil
}
guard let activateAnimationFile = telegramMediaFileFromApiDocument(activateAnimation) else {
guard let activateAnimationFile = telegramMediaFileFromApiDocument(activateAnimation, altDocuments: []) else {
return nil
}
guard let effectAnimationFile = telegramMediaFileFromApiDocument(effectAnimation) else {
guard let effectAnimationFile = telegramMediaFileFromApiDocument(effectAnimation, altDocuments: []) else {
return nil
}
let aroundAnimationFile = aroundAnimation.flatMap { telegramMediaFileFromApiDocument($0) }
let centerAnimationFile = centerIcon.flatMap { telegramMediaFileFromApiDocument($0) }
let aroundAnimationFile = aroundAnimation.flatMap { telegramMediaFileFromApiDocument($0, altDocuments: []) }
let centerAnimationFile = centerIcon.flatMap { telegramMediaFileFromApiDocument($0, altDocuments: []) }
let isEnabled = (flags & (1 << 0)) == 0
let isPremium = (flags & (1 << 2)) != 0
self.init(