Skip to content

Commit

Permalink
Merge pull request Expensify#47849 from neonbhai/video-playback-speed…
Browse files Browse the repository at this point in the history
…-fix

Add finer playback speeds
  • Loading branch information
techievivek committed Aug 23, 2024
2 parents 259a9b7 + 2a2dd64 commit 6488908
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4183,7 +4183,7 @@ const CONST = {

VIDEO_PLAYER: {
POPOVER_Y_OFFSET: -30,
PLAYBACK_SPEEDS: [0.25, 0.5, 1, 1.5, 2],
PLAYBACK_SPEEDS: [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2],
HIDE_TIME_TEXT_WIDTH: 250,
MIN_WIDTH: 170,
MIN_HEIGHT: 120,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const Context = React.createContext<VideoPopoverMenuContext | null>(null);
function VideoPopoverMenuContextProvider({children}: ChildrenProps) {
const {currentlyPlayingURL} = usePlaybackContext();
const {translate} = useLocalize();
const [currentPlaybackSpeed, setCurrentPlaybackSpeed] = useState<PlaybackSpeed>(CONST.VIDEO_PLAYER.PLAYBACK_SPEEDS[2]);
const [currentPlaybackSpeed, setCurrentPlaybackSpeed] = useState<PlaybackSpeed>(CONST.VIDEO_PLAYER.PLAYBACK_SPEEDS[3]);
const {isOffline} = useNetwork();
const isLocalFile = currentlyPlayingURL && CONST.ATTACHMENT_LOCAL_URL_PREFIX.some((prefix) => currentlyPlayingURL.startsWith(prefix));
const videoPopoverMenuPlayerRef = useRef<VideoWithOnFullScreenUpdate | null>(null);
Expand Down Expand Up @@ -57,7 +57,7 @@ function VideoPopoverMenuContextProvider({children}: ChildrenProps) {
text: translate('videoPlayer.playbackSpeed'),
subMenuItems: CONST.VIDEO_PLAYER.PLAYBACK_SPEEDS.map((speed) => ({
icon: currentPlaybackSpeed === speed ? Expensicons.Checkmark : undefined,
text: speed.toString(),
text: speed === 1 ? translate('videoPlayer.normal') : speed.toString(),
onSelected: () => {
updatePlaybackSpeed(speed);
},
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4210,6 +4210,7 @@ export default {
expand: 'Expand',
mute: 'Mute',
unmute: 'Unmute',
normal: 'Normal',
},
exitSurvey: {
header: 'Before you go',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4724,6 +4724,7 @@ export default {
expand: 'Expandir',
mute: 'Silenciar',
unmute: 'Activar sonido',
normal: 'Normal',
},
exitSurvey: {
header: 'Antes de irte',
Expand Down

0 comments on commit 6488908

Please sign in to comment.