fix(player): fix autopause on tabs
This commit is contained in:
parent
8aa14a68c9
commit
ce711f40c2
1 changed files with 8 additions and 2 deletions
|
|
@ -69,10 +69,10 @@ function WebPlayer(props: any) {
|
|||
}
|
||||
}, [session.events, session.errors, contextValue.player])
|
||||
|
||||
const { ready: isPlayerReady, firstVisualEvent: visualOffset, messagesProcessed } = contextValue.store?.get() || {}
|
||||
const { firstVisualEvent: visualOffset, messagesProcessed } = contextValue.store?.get() || {}
|
||||
|
||||
React.useEffect(() => {
|
||||
if (showNoteModal || activeTab !== '') {
|
||||
if (showNoteModal) {
|
||||
contextValue.player.pause()
|
||||
}
|
||||
|
||||
|
|
@ -93,6 +93,12 @@ function WebPlayer(props: any) {
|
|||
}
|
||||
}, [activeTab, showNoteModal, visualOffset, messagesProcessed])
|
||||
|
||||
React.useEffect(() => {
|
||||
if (activeTab === 'Click Map') {
|
||||
contextValue.player?.pause()
|
||||
}
|
||||
}, [activeTab])
|
||||
|
||||
// LAYOUT (TODO: local layout state - useContext or something..)
|
||||
useEffect(
|
||||
() => () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue