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