add cb function
This commit is contained in:
@@ -2,8 +2,11 @@ import {requireNativeModule} from 'expo'
|
|||||||
|
|
||||||
const NativeModule = requireNativeModule('ExpoHLSDownload')
|
const NativeModule = requireNativeModule('ExpoHLSDownload')
|
||||||
|
|
||||||
export async function downloadAsync(sourceUrl: string): Promise<string> {
|
export async function downloadAsync(
|
||||||
return NativeModule.downloadAsync(sourceUrl)
|
sourceUrl: string,
|
||||||
|
progressCb: (progress: number) => void,
|
||||||
|
): Promise<string> {
|
||||||
|
return NativeModule.downloadAsync(sourceUrl, progressCb)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function cancelAsync(sourceUrl: string): Promise<void> {
|
export async function cancelAsync(sourceUrl: string): Promise<void> {
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
import {NotImplementedError} from '../NotImplemented'
|
import {NotImplementedError} from '../NotImplemented'
|
||||||
|
|
||||||
export function downloadAsync(sourceUrl: string): Promise<string> {
|
export function downloadAsync(
|
||||||
throw new NotImplementedError({sourceUrl})
|
sourceUrl: string,
|
||||||
|
progressCb: (progress: number) => void,
|
||||||
|
): Promise<string> {
|
||||||
|
throw new NotImplementedError({sourceUrl, progressCb})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function cancelAsync(sourceUrl: string): Promise<void> {
|
export function cancelAsync(sourceUrl: string): Promise<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user