"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.parseLiveStateResolutionChangeMessage=exports.getVideoErrorRetryAction=exports.VideoErrorRetryAction=void 0;var parseLiveStateResolutionChangeMessage=function(r){var e=r.match(/resolution:(\d+)x(\d+)/);return e?{width:Number(e[1]),height:Number(e[2])}:null};exports.parseLiveStateResolutionChangeMessage=parseLiveStateResolutionChangeMessage;var VIDEO_REPORT_ONLY_ERROR_PATTERNS=[/bufferSeekOverhole/i,/bufferStalledError/i,/bufferNudgeOnStall/i],VIDEO_RETRYABLE_ERROR_PATTERNS=[/MEDIA_ERR_NETWORK/i,/networkError/i,/fragLoadError/i,/manifestLoadError/i,/fragParsingError/i,/fragLoopLoadingError/i],VIDEO_RESTART_ERROR_PATTERNS=[/MEDIA_ERR_DECODE/i,/MEDIA_ERR_SRC_NOT_SUPPORTED/i],VIDEO_NON_RETRYABLE_ERROR_PATTERNS=[],VideoErrorRetryAction={NONE:"none",PLAY:"play",REPORT_ONLY:"report_only",RESTART:"restart"};exports.VideoErrorRetryAction=VideoErrorRetryAction;var getVideoErrorRetryAction=function(r,e){var o="".concat(e||""," ").concat((null==r?void 0:r.errMsg)||""," ").concat((null==r?void 0:r.message)||""," ").concat((null==r?void 0:r.msg)||"");return VIDEO_NON_RETRYABLE_ERROR_PATTERNS.some(function(r){return r.test(o)})?VideoErrorRetryAction.NONE:VIDEO_REPORT_ONLY_ERROR_PATTERNS.some(function(r){return r.test(o)})?VideoErrorRetryAction.REPORT_ONLY:VIDEO_RESTART_ERROR_PATTERNS.some(function(r){return r.test(o)})?VideoErrorRetryAction.RESTART:(VIDEO_RETRYABLE_ERROR_PATTERNS.some(function(r){return r.test(o)}),VideoErrorRetryAction.PLAY)};exports.getVideoErrorRetryAction=getVideoErrorRetryAction;