Restore video loading circle

## Issue
5554: Video: loading circle sometimes does not appear until 2nd click

## What's happening
videojs behavior:
(a) A `src` change makes the Play button re-appear.
(b) An `onPlay` (or `play()`) makes the button go away.

Due to the `m3u8` header async fetch (i.e. return is potentially delayed), the initial `onPlay` (which cleared the button) that happened after user clicked Play gets negated by a potentially-delayed `src` change.

# Changes
- Manually hide the play button that is induced by the change in `src`. In the fetch-delay scenario mentioned above, the player continues to be in a 'playing' state anyway.
- But don't hide the button if paused externally (e.g. browser-level)
Restore video loading circle
This commit is contained in:
infinite-persistence 2021-03-02 10:01:05 +08:00 committed by Sean Yesmunt
parent 7d3653d787
commit 05383701af

View file

@ -453,6 +453,11 @@ export default React.memo<Props>(function VideoJs(props: Props) {
src: source, src: source,
type: type, type: type,
}); });
// PR #5570: Temp workaround to avoid double Play button until the next re-architecture.
if (!player.paused()) {
player.bigPlayButton.hide();
}
}); });
}, [source, reload]); }, [source, reload]);