sync this.type with props.type
This commit is contained in:
@@ -1485,11 +1485,14 @@ const VideoPlayerBase = class extends React.Component {
|
||||
return;
|
||||
}
|
||||
|
||||
this.type = this.props.type;
|
||||
|
||||
updatedState.currentTime =
|
||||
this.type === "LIVE" ? this.state.currentLiveTimeSeconds : el.currentTime;
|
||||
|
||||
updatedState.duration =
|
||||
this.type === "LIVE" ? this.state.liveTotalTime : el.duration;
|
||||
|
||||
//last time error : for youtube
|
||||
if (this.props.isYoutube && ev.type === "onProgress") {
|
||||
if (updatedState.duration - updatedState.currentTime < 1.0) {
|
||||
@@ -2453,7 +2456,7 @@ const VideoPlayerBase = class extends React.Component {
|
||||
<div
|
||||
className={classNames(
|
||||
css.fullscreen,
|
||||
panelInfo.shptmBanrTpNm === "LIVE" && css.liveFullScreen
|
||||
type === "LIVE" && css.liveFullScreen
|
||||
)}
|
||||
{...controlsAriaProps}
|
||||
>
|
||||
@@ -2495,9 +2498,7 @@ const VideoPlayerBase = class extends React.Component {
|
||||
<Times
|
||||
noCurrentTime
|
||||
total={
|
||||
panelInfo.shptmBanrTpNm === "LIVE"
|
||||
? liveTotalTime
|
||||
: this.state.duration
|
||||
type === "LIVE" ? liveTotalTime : this.state.duration
|
||||
}
|
||||
formatter={durFmt}
|
||||
type={type}
|
||||
@@ -2507,7 +2508,7 @@ const VideoPlayerBase = class extends React.Component {
|
||||
<Times
|
||||
noTotalTime
|
||||
current={
|
||||
panelInfo.shptmBanrTpNm === "LIVE"
|
||||
type === "LIVE"
|
||||
? currentLiveTimeSeconds
|
||||
: this.state.currentTime
|
||||
}
|
||||
|
||||
@@ -1927,6 +1927,7 @@ const PlayerPanel = ({
|
||||
|
||||
return panelInfo.shptmBanrTpNm;
|
||||
}, [panelInfo.shptmBanrTpNm, playListInfo, selectedIndex]);
|
||||
|
||||
const clearTimer = useCallback(() => {
|
||||
clearTimeout(timerId.current);
|
||||
timerId.current = null;
|
||||
|
||||
Reference in New Issue
Block a user