feat hls分片加在成功后播放
This commit is contained in:
@@ -5,10 +5,6 @@
|
||||
"ComputedRef": true,
|
||||
"DirectiveBinding": true,
|
||||
"EffectScope": true,
|
||||
"ElLoading": true,
|
||||
"ElMessage": true,
|
||||
"ElMessageBox": true,
|
||||
"ElNotification": true,
|
||||
"ExtractDefaultPropTypes": true,
|
||||
"ExtractPropTypes": true,
|
||||
"ExtractPublicPropTypes": true,
|
||||
|
||||
@@ -46,6 +46,12 @@ export const initHls = (monitorVideoUrl, monitorVideoRef, isDialogVisible?: () =
|
||||
switch (data.type) {
|
||||
case Hls.ErrorTypes.NETWORK_ERROR:
|
||||
hls.startLoad();
|
||||
hls.once(Hls.Events.FRAG_LOADED, () => {
|
||||
//分片加载成功后播放
|
||||
try {
|
||||
video.play().catch(() => {});
|
||||
} catch (e) {}
|
||||
});
|
||||
ElMessage.error('网络错误, 请检查网络或重试');
|
||||
break;
|
||||
case Hls.ErrorTypes.MEDIA_ERROR:
|
||||
|
||||
Reference in New Issue
Block a user