[Video] Download videos (#4886)
Co-authored-by: Samuel Newman <10959775+mozzius@users.noreply.github.com>
This commit is contained in:
parent
b9975697e2
commit
11061b628e
19 changed files with 747 additions and 3 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue