Skip to content
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

Merged
merged 17 commits into from
Nov 28, 2022
Merged

Conversation

tymmesyde
Copy link
Member

Screencast.from.2022-11-03.05-52-32.webm

@nklhtv nklhtv self-requested a review November 28, 2022 10:11
@@ -0,0 +1,5 @@
// Copyright (C) 2017-2022 Smart code 203358507

const NextEpisodeModal = require('./NextVideoPopup');
Copy link
Collaborator

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

@@ -539,6 +563,18 @@ const Player = ({ urlParams, queryParams }) => {
onMouseMove={onBarMouseMove}
onMouseOver={onBarMouseMove}
/>
{
!subtitlesMenuOpen && !infoMenuOpen && !videosMenuOpen && nextVideoPopupOpen ?
Copy link
Collaborator

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

@@ -313,6 +325,17 @@ const Player = ({ urlParams, queryParams }) => {
pausedChanged(videoState.paused);
}
}, [videoState.paused]);
React.useEffect(() => {
if (nextVideoPopupDismissed.current === false) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use !nextVideoPopupDismissed.current here

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)) {
Copy link
Collaborator

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

} else {
window.history.back();
}
}, [player.libraryItem, player.nextVideo]);
}, [player.libraryItem, player.nextVideo, onPlayNextVideoRequested]);
Copy link
Collaborator

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 Show resolved Hide resolved
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)) {
Copy link
Collaborator

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

@tymmesyde tymmesyde marked this pull request as ready for review November 28, 2022 12:29
@nklhtv nklhtv merged commit 0771cd7 into development Nov 28, 2022
@nklhtv nklhtv deleted the feat/player-next-video-popup branch May 25, 2023 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants