fix(player): fix abs time tooltip tracking
This commit is contained in:
parent
73d6fc9dab
commit
64cea03ce0
4 changed files with 14 additions and 5 deletions
|
|
@ -25,7 +25,11 @@ function WebPlayer(props: any) {
|
|||
);
|
||||
setContextValue({ player: WebPlayerInst, store: PlayerStore });
|
||||
|
||||
return () => WebPlayerInst.clean();
|
||||
return () => {
|
||||
WebPlayerInst.clean();
|
||||
// @ts-ignore
|
||||
setContextValue(defaultContextValue);
|
||||
}
|
||||
}, [session.sessionId]);
|
||||
|
||||
const isPlayerReady = contextValue.store?.get().ready
|
||||
|
|
|
|||
|
|
@ -81,7 +81,12 @@ function Timeline(props: IProps) {
|
|||
};
|
||||
|
||||
const showTimeTooltip = (e: React.MouseEvent<HTMLDivElement>) => {
|
||||
if (e.target !== progressRef.current && e.target !== timelineRef.current) {
|
||||
if (
|
||||
e.target !== progressRef.current
|
||||
&& e.target !== timelineRef.current
|
||||
// @ts-ignore black magic
|
||||
&& !progressRef.current.contains(e.target)
|
||||
) {
|
||||
return props.tooltipVisible && hideTimeTooltip();
|
||||
}
|
||||
|
||||
|
|
@ -91,7 +96,7 @@ function Timeline(props: IProps) {
|
|||
const timeLineTooltip = {
|
||||
time: Duration.fromMillis(time).toFormat(`mm:ss`),
|
||||
timeStr,
|
||||
offset: e.nativeEvent.offsetX,
|
||||
offset: e.nativeEvent.pageX,
|
||||
isVisible: true,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ function TimeTooltip({
|
|||
className={stl.timeTooltip}
|
||||
style={{
|
||||
top: 0,
|
||||
left: offset,
|
||||
left: `calc(${offset}px - 0.5rem)`,
|
||||
display: isVisible ? 'block' : 'none',
|
||||
transform: 'translate(-50%, -110%)',
|
||||
whiteSpace: 'nowrap',
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
"socket.io-client": "^4.4.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@openreplay/tracker": ">=3.6.0"
|
||||
"@openreplay/tracker": ">=5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@openreplay/tracker": "file:../tracker",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue