Merge pull request #2246 from derek-yesmunt/master
fix #2240: reset time to zero on file end
This commit is contained in:
commit
d63d314406
3 changed files with 8 additions and 8 deletions
|
@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
### Fixed
|
||||
|
||||
- Flow errors ([#2213](https://github.com/lbryio/lbry-desktop/pull/2213))
|
||||
- Video position on previously viewed files ([#2240](https://github.com/lbryio/lbry-desktop/pull/2240))
|
||||
|
||||
## [0.27.1] - 2018-01-22
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ class MediaPlayer extends React.PureComponent {
|
|||
claim,
|
||||
onStartCb,
|
||||
onFinishCb,
|
||||
savePosition,
|
||||
} = this.props;
|
||||
|
||||
const loadedMetadata = () => {
|
||||
|
@ -95,13 +96,7 @@ class MediaPlayer extends React.PureComponent {
|
|||
if (position) {
|
||||
mediaElement.currentTime = position;
|
||||
}
|
||||
mediaElement.addEventListener('timeupdate', () =>
|
||||
this.props.savePosition(
|
||||
claim.claim_id,
|
||||
`${claim.txid}:${claim.nout}`,
|
||||
mediaElement.currentTime
|
||||
)
|
||||
);
|
||||
mediaElement.addEventListener('timeupdate', () => savePosition(mediaElement.currentTime));
|
||||
mediaElement.addEventListener('click', this.togglePlayListener);
|
||||
mediaElement.addEventListener('loadedmetadata', loadedMetadata.bind(this), {
|
||||
once: true,
|
||||
|
@ -110,6 +105,7 @@ class MediaPlayer extends React.PureComponent {
|
|||
if (onFinishCb) {
|
||||
onFinishCb();
|
||||
}
|
||||
savePosition(0);
|
||||
});
|
||||
mediaElement.addEventListener('webkitfullscreenchange', win32FullScreenChange.bind(this));
|
||||
mediaElement.addEventListener('volumechange', () => {
|
||||
|
|
|
@ -18,6 +18,7 @@ type Props = {
|
|||
written_bytes: number,
|
||||
download_path: string,
|
||||
completed: boolean,
|
||||
blobs_completed: number,
|
||||
},
|
||||
fileInfoErrors: ?{
|
||||
[string]: boolean,
|
||||
|
@ -259,7 +260,9 @@ class FileViewer extends React.PureComponent<Props> {
|
|||
downloadCompleted={fileInfo.completed}
|
||||
changeVolume={changeVolume}
|
||||
volume={volume}
|
||||
savePosition={savePosition}
|
||||
savePosition={newPosition =>
|
||||
savePosition(claim.claim_id, `${claim.txid}:${claim.nout}`, newPosition)
|
||||
}
|
||||
claim={claim}
|
||||
uri={uri}
|
||||
position={position}
|
||||
|
|
Loading…
Reference in a new issue