From a4a0a0644ea08d22a2c0c52c7c1a78290e7869a9 Mon Sep 17 00:00:00 2001 From: Yuki Kodama Date: Tue, 28 May 2019 12:30:27 +0900 Subject: [PATCH 1/2] Fix typing of arguments of onError handler onError handler has 4 arguments: https://github.com/CookPete/react-player/blob/master/src/players/FilePlayer.js#L130 --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 6200b3f9..506e44cf 100644 --- a/index.d.ts +++ b/index.d.ts @@ -102,7 +102,7 @@ export interface ReactPlayerProps { onEnded?(): void; onEnablePIP?(): void; onDisablePIP?(): void; - onError?(error: any): void; + onError?(error: any, data: any, hls: any, cls: any): void; onDuration?(duration: number): void; onSeek?(seconds: number): void; onProgress?(state: { played: number, playedSeconds: number, loaded: number, loadedSeconds: number }): void; From 48b1af2ce05dd64b4b54ecc4f9a4427d7c1e8906 Mon Sep 17 00:00:00 2001 From: Pete Cook Date: Wed, 5 Jun 2019 20:51:58 +0100 Subject: [PATCH 2/2] Make extra onError params optional --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 506e44cf..bf4daee3 100644 --- a/index.d.ts +++ b/index.d.ts @@ -102,7 +102,7 @@ export interface ReactPlayerProps { onEnded?(): void; onEnablePIP?(): void; onDisablePIP?(): void; - onError?(error: any, data: any, hls: any, cls: any): void; + onError?(error: any, data?: any, hlsInstance?: any, hlsGlobal?: any): void; onDuration?(duration: number): void; onSeek?(seconds: number): void; onProgress?(state: { played: number, playedSeconds: number, loaded: number, loadedSeconds: number }): void;