-
Notifications
You must be signed in to change notification settings - Fork 224
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
Conversation
src/routes/Player/Player.js
Outdated
@@ -313,6 +315,17 @@ const Player = ({ urlParams, queryParams }) => { | |||
pausedChanged(videoState.paused); | |||
} | |||
}, [videoState.paused]); | |||
React.useEffect(() => { | |||
if (defaultAudioTrackSelected.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.
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); |
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.
reset defaultAudioTrackSelected to false when videoState.stream changes
src/routes/Player/Player.js
Outdated
defaultAudioTrackSelected.current = true; | ||
} | ||
} | ||
}, [videoState.audioTracks, settings.audioLanguage]); |
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.
Should we trigger this effect when settings.audioLanguage
change
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.
Maybe that's not necessary yes
…into feat/player-default-audio-track
…into feat/player-default-audio-track
Add audio track setting to Settings
Select default audio track on Player