Don't clear on position on dispose

Otherwise, we'll never see a full progress indicator. The "reset when too near end of video" should only happen when opening a file.
This commit is contained in:
infinite-persistence 2022-04-01 22:59:35 +08:00 committed by Thomas Zarebczan
parent 84b9bd617a
commit 4e63849061

View file

@ -1,7 +1,6 @@
// @flow // @flow
import { ENABLE_PREROLL_ADS } from 'config'; import { ENABLE_PREROLL_ADS } from 'config';
import * as PAGES from 'constants/pages'; import * as PAGES from 'constants/pages';
import { VIDEO_ALMOST_FINISHED_THRESHOLD } from 'constants/player';
import * as ICONS from 'constants/icons'; import * as ICONS from 'constants/icons';
import React, { useEffect, useState, useContext, useCallback } from 'react'; import React, { useEffect, useState, useContext, useCallback } from 'react';
import { stopContextMenu } from 'util/context-menu'; import { stopContextMenu } from 'util/context-menu';
@ -295,12 +294,6 @@ function VideoViewer(props: Props) {
function onDispose(event, player) { function onDispose(event, player) {
handlePosition(player); handlePosition(player);
analytics.videoIsPlaying(false, player); analytics.videoIsPlaying(false, player);
const almostFinished = player.currentTime() / player.duration() >= VIDEO_ALMOST_FINISHED_THRESHOLD;
if (player.ended() || almostFinished) {
clearPosition(permanentUrl);
}
} }
function handlePosition(player) { function handlePosition(player) {