position tracking clean up
This commit is contained in:
parent
287f1ac656
commit
58ed68d8c3
3 changed files with 7 additions and 5 deletions
|
@ -29,7 +29,7 @@ const select = (state, props) => ({
|
|||
playingUri: selectPlayingUri(state),
|
||||
contentType: makeSelectContentTypeForUri(props.uri)(state),
|
||||
volume: selectVolume(state),
|
||||
playbackPosition: makeSelectContentPositionForUri(props.uri)(state),
|
||||
position: makeSelectContentPositionForUri(props.uri)(state),
|
||||
autoplay: makeSelectClientSetting(settings.AUTOPLAY)(state),
|
||||
searchBarFocused: selectSearchBarFocused(state),
|
||||
fileInfoErrors: selectFileInfoErrors(state),
|
||||
|
|
|
@ -88,7 +88,9 @@ class MediaPlayer extends React.PureComponent {
|
|||
document.addEventListener('keydown', this.togglePlayListener);
|
||||
const mediaElement = this.media.children[0];
|
||||
if (mediaElement) {
|
||||
mediaElement.currentTime = position || 0;
|
||||
if (position) {
|
||||
mediaElement.currentTime = position;
|
||||
}
|
||||
mediaElement.addEventListener('timeupdate', () =>
|
||||
this.props.savePosition(
|
||||
claim.claim_id,
|
||||
|
|
|
@ -35,7 +35,7 @@ type Props = {
|
|||
claim: Claim,
|
||||
uri: string,
|
||||
savePosition: (string, string, number) => void,
|
||||
playbackPosition: ?number,
|
||||
position: ?number,
|
||||
className: ?string,
|
||||
obscureNsfw: boolean,
|
||||
play: string => void,
|
||||
|
@ -200,7 +200,7 @@ class FileViewer extends React.PureComponent<Props> {
|
|||
claim,
|
||||
uri,
|
||||
savePosition,
|
||||
playbackPosition,
|
||||
position,
|
||||
className,
|
||||
obscureNsfw,
|
||||
mediaType,
|
||||
|
@ -249,7 +249,7 @@ class FileViewer extends React.PureComponent<Props> {
|
|||
savePosition={savePosition}
|
||||
claim={claim}
|
||||
uri={uri}
|
||||
position={playbackPosition}
|
||||
position={position}
|
||||
playingUri={playingUri}
|
||||
/>
|
||||
)}
|
||||
|
|
Loading…
Add table
Reference in a new issue