diff --git a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx index 7c792167..b9bcc01a 100644 --- a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx +++ b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx @@ -139,7 +139,7 @@ const YOUTUBECONFIG = { cc_lang_pref: "en", cc_load_policy: 0, }, -} +}; const PlayerPanel = ({ isTabActivated, @@ -940,9 +940,9 @@ const PlayerPanel = ({ return; } - if(isYoutube){ + if (isYoutube) { //do caption action on VideoPlayer(componentDidUpdate) - }else{ + } else { if (mediaId && captionEnable && isSubtitleActive && !panelInfo?.modal) { dispatch(requestLiveSubtitle({ mediaId, enable: true })); } else { @@ -1167,8 +1167,10 @@ const PlayerPanel = ({ const newSmallestOffsetHourIndex = shopNowInfo.findIndex( (video) => video.offsetHour === newSmallestOffsetHour.toString() ); - - return newSmallestOffsetHourIndex - 1; + if (newSmallestOffsetHourIndex >= 1) { + return newSmallestOffsetHourIndex - 1; + } + return newSmallestOffsetHourIndex; } }, [shopNowInfo, currentTime]); @@ -1266,8 +1268,8 @@ const PlayerPanel = ({ }; } else { return { - youtube: YOUTUBECONFIG - } + youtube: YOUTUBECONFIG, + }; } }, [currentSubtitleBlob, isSubtitleActive]);