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