-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: player next video popup #318
Conversation
@@ -0,0 +1,5 @@ | |||
// Copyright (C) 2017-2022 Smart code 203358507 | |||
|
|||
const NextEpisodeModal = require('./NextVideoPopup'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you match the naming here
src/routes/Player/Player.js
Outdated
@@ -539,6 +563,18 @@ const Player = ({ urlParams, queryParams }) => { | |||
onMouseMove={onBarMouseMove} | |||
onMouseOver={onBarMouseMove} | |||
/> | |||
{ | |||
!subtitlesMenuOpen && !infoMenuOpen && !videosMenuOpen && nextVideoPopupOpen ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the check here should be just nextVideoPopupOpen
i think
src/routes/Player/Player.js
Outdated
@@ -313,6 +325,17 @@ const Player = ({ urlParams, queryParams }) => { | |||
pausedChanged(videoState.paused); | |||
} | |||
}, [videoState.paused]); | |||
React.useEffect(() => { | |||
if (nextVideoPopupDismissed.current === false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use !nextVideoPopupDismissed.current
here
src/routes/Player/Player.js
Outdated
React.useEffect(() => { | ||
if (nextVideoPopupDismissed.current === false) { | ||
if (videoState.time !== null && !isNaN(videoState.time) && videoState.duration !== null && !isNaN(videoState.duration)) { | ||
if (videoState.time < videoState.duration && (videoState.duration - videoState.time) <= (35 * 1000)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you wont need the isNaN checks
src/routes/Player/Player.js
Outdated
} else { | ||
window.history.back(); | ||
} | ||
}, [player.libraryItem, player.nextVideo]); | ||
}, [player.libraryItem, player.nextVideo, onPlayNextVideoRequested]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should not depend on player.libraryItem now
src/routes/Player/Player.js
Outdated
React.useEffect(() => { | ||
if (nextVideoPopupDismissed.current === false) { | ||
if (videoState.time !== null && !isNaN(videoState.time) && videoState.duration !== null && !isNaN(videoState.duration)) { | ||
if (videoState.time < videoState.duration && (videoState.duration - videoState.time) <= (35 * 1000)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am not sure if you can combine all of those if statements into one
…into feat/player-next-video-popup
…r next video popup
Screencast.from.2022-11-03.05-52-32.webm