[Video] Download videos (#4886)

Co-authored-by: Samuel Newman <10959775+mozzius@users.noreply.github.com>
This commit is contained in:
Hailey 2024-08-15 11:23:48 -07:00 committed by GitHub
parent b9975697e2
commit 11061b628e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 747 additions and 3 deletions

View file

@ -0,0 +1,31 @@
import ExpoModulesCore
public class ExpoHLSDownloadModule: Module {
public func definition() -> ModuleDefinition {
Name("ExpoHLSDownload")
Function("isAvailable") {
if #available(iOS 14.5, *) {
return true
}
return false
}
View(HLSDownloadView.self) {
Events([
"onStart",
"onError",
"onProgress",
"onSuccess"
])
Prop("downloaderUrl") { (view: HLSDownloadView, downloaderUrl: URL) in
view.downloaderUrl = downloaderUrl
}
AsyncFunction("startDownloadAsync") { (view: HLSDownloadView, sourceUrl: URL) in
view.startDownload(sourceUrl: sourceUrl)
}
}
}
}