Typescript

This commit is contained in:
Ivan Malison 2024-10-17 18:58:17 -06:00
parent e5f182cda9
commit 4dc7bf465f

View File

@ -330,7 +330,9 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
}); });
} }
//@ts-ignore
shakaPlayerRef.current.addEventListener('error', event => { shakaPlayerRef.current.addEventListener('error', event => {
//@ts-ignore
const shakaError = event.detail; const shakaError = event.detail;
console.error('Shaka Player Error', shakaError); console.error('Shaka Player Error', shakaError);
onError?.({ onError?.({
@ -345,6 +347,7 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
// Load the new source // Load the new source
try { try {
//@ts-ignore
await shakaPlayerRef.current.load(source?.uri); await shakaPlayerRef.current.load(source?.uri);
console.log(`${source?.uri} finished loading`); console.log(`${source?.uri} finished loading`);
@ -360,7 +363,9 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
console.error('Error loading video with Shaka Player', e); console.error('Error loading video with Shaka Player', e);
onError?.({ onError?.({
error: { error: {
//@ts-ignore
errorString: e.message, errorString: e.message,
//@ts-ignore
code: e.code, code: e.code,
}, },
}); });
@ -382,6 +387,7 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
'New source', 'New source',
source, source,
); );
//@ts-ignore
setCurrentSource(source); setCurrentSource(source);
makeNewShaka(); makeNewShaka();
} }