Typescript
This commit is contained in:
parent
e5f182cda9
commit
4dc7bf465f
@ -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();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user