Use the maxUploadSize in the media upload screen. (#4359)

* Fix a bug where some files sizes were sent as 0.

* Make FileManger.sizeForItem(at:) a UInt.

The docs specifically say that FileAttributeKey.size returns an unsigned long long so I have no idea why we were returning a Double here…

* Add the maxMediaUploadSize property on ClientProxy.

* Use the maxUploadSize to set a target video size and to show a file too big error.

* Refactor media upload parameter order.
This commit is contained in:
Doug
2025-07-29 12:18:53 +01:00
committed by GitHub
parent b91c0c3930
commit 75bc26d20b
23 changed files with 270 additions and 101 deletions
@@ -9,13 +9,14 @@ import Combine
import SwiftUI
struct MediaUploadPreviewScreenCoordinatorParameters {
let timelineController: TimelineControllerProtocol
let userIndicatorController: UserIndicatorControllerProtocol
let mediaUploadingPreprocessor: MediaUploadingPreprocessor
let title: String?
let url: URL
let shouldShowCaptionWarning: Bool
let title: String?
let isRoomEncrypted: Bool
let shouldShowCaptionWarning: Bool
let mediaUploadingPreprocessor: MediaUploadingPreprocessor
let timelineController: TimelineControllerProtocol
let clientProxy: ClientProxyProtocol
let userIndicatorController: UserIndicatorControllerProtocol
}
enum MediaUploadPreviewScreenCoordinatorAction {
@@ -32,13 +33,14 @@ final class MediaUploadPreviewScreenCoordinator: CoordinatorProtocol {
}
init(parameters: MediaUploadPreviewScreenCoordinatorParameters) {
viewModel = MediaUploadPreviewScreenViewModel(timelineController: parameters.timelineController,
userIndicatorController: parameters.userIndicatorController,
mediaUploadingPreprocessor: parameters.mediaUploadingPreprocessor,
viewModel = MediaUploadPreviewScreenViewModel(url: parameters.url,
title: parameters.title,
url: parameters.url,
isRoomEncrypted: parameters.isRoomEncrypted,
shouldShowCaptionWarning: parameters.shouldShowCaptionWarning,
isRoomEncrypted: parameters.isRoomEncrypted)
mediaUploadingPreprocessor: parameters.mediaUploadingPreprocessor,
timelineController: parameters.timelineController,
clientProxy: parameters.clientProxy,
userIndicatorController: parameters.userIndicatorController)
}
func start() {