Skip to content

Commit

Permalink
fix: ignore invalid playback rate on video load
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmaddock committed Jul 1, 2020
1 parent c10005d commit be0a797
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/metastream-app/src/components/lobby/VideoPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,9 @@ class _VideoPlayer extends PureComponent<PrivateProps, IState> {

private onMediaPlaybackRateChange = throttle(
(playbackRate: number) => {
// ignore invalid sent when video is loading
if (playbackRate <= 0) return

this.props.dispatch(server_requestSetPlaybackRate(playbackRate))
},
200,
Expand Down
2 changes: 1 addition & 1 deletion packages/metastream-app/src/lobby/actions/mediaPlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { addChat } from './chat'
export const playPauseMedia = actionCreator<void>('PLAY_PAUSE_MEDIA')
export const repeatMedia = actionCreator<number>('REPEAT_MEDIA')
export const seekMedia = actionCreator<number>('SEEK_MEDIA')
export const setPlaybackRate = actionCreator<number>('SEEK_PLAYBACK_RATE')
export const setPlaybackRate = actionCreator<number>('SET_PLAYBACK_RATE')
export const setMedia = actionCreator<IMediaItem>('SET_MEDIA')
export const endMedia = actionCreator<boolean /* force */>('END_MEDIA')
export const queueMedia = actionCreator<{ media: IMediaItem; index?: number }>('QUEUE_MEDIA')
Expand Down

0 comments on commit be0a797

Please sign in to comment.