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 default audio track #317

Merged
merged 6 commits into from
Nov 28, 2022
Merged

Conversation

tymmesyde
Copy link
Member

Add audio track setting to Settings
Select default audio track on Player

@@ -313,6 +315,17 @@ const Player = ({ urlParams, queryParams }) => {
pausedChanged(videoState.paused);
}
}, [videoState.paused]);
React.useEffect(() => {
if (defaultAudioTrackSelected.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.

if (!defaultAudioTrackSelected.current) {
looks better

@@ -40,6 +41,7 @@ const Player = ({ urlParams, queryParams }) => {
const [subtitlesMenuOpen, , closeSubtitlesMenu, toggleSubtitlesMenu] = useBinaryState(false);
const [infoMenuOpen, , closeInfoMenu, toggleInfoMenu] = useBinaryState(false);
const [videosMenuOpen, , closeVideosMenu, toggleVideosMenu] = useBinaryState(false);
const defaultAudioTrackSelected = React.useRef(false);
Copy link
Collaborator

Choose a reason for hiding this comment

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

reset defaultAudioTrackSelected to false when videoState.stream changes

defaultAudioTrackSelected.current = true;
}
}
}, [videoState.audioTracks, settings.audioLanguage]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we trigger this effect when settings.audioLanguage change

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe that's not necessary yes

@nklhtv nklhtv merged commit 04c6c29 into development Nov 28, 2022
@nklhtv nklhtv deleted the feat/player-default-audio-track 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.

None yet

2 participants