mirror of
https://gitlab.com/futo-org/fcast.git
synced 2025-06-24 21:25:23 +00:00
Receivers: Delay showing loading spinner
This commit is contained in:
parent
c12e1aff58
commit
6a14b98f6b
1 changed files with 4 additions and 5 deletions
|
@ -81,11 +81,9 @@ let uiHideTimer = new Timer(() => {
|
||||||
uiVisible = false;
|
uiVisible = false;
|
||||||
playerCtrlStateUpdate(PlayerControlEvent.UiFadeOut);
|
playerCtrlStateUpdate(PlayerControlEvent.UiFadeOut);
|
||||||
}, 3000);
|
}, 3000);
|
||||||
|
let loadingTimer = new Timer(() => { loadingSpinner.style.display = 'block'; }, 50, false);
|
||||||
let showDurationTimer = new Timer(mediaEndHandler, 0, false);
|
let showDurationTimer = new Timer(mediaEndHandler, 0, false);
|
||||||
let mediaTitleShowTimer = new Timer(() => {
|
let mediaTitleShowTimer = new Timer(() => { mediaTitle.style.display = 'none'; }, 5000);
|
||||||
mediaTitle.style.display = 'none';
|
|
||||||
}, 5000);
|
|
||||||
|
|
||||||
function formatDuration(duration: number) {
|
function formatDuration(duration: number) {
|
||||||
if (isNaN(duration)) {
|
if (isNaN(duration)) {
|
||||||
|
@ -119,6 +117,7 @@ function sendPlaybackUpdate(updateState: PlaybackState) {
|
||||||
|
|
||||||
function onPlayerLoad(value: PlayMessage) {
|
function onPlayerLoad(value: PlayMessage) {
|
||||||
playerCtrlStateUpdate(PlayerControlEvent.Load);
|
playerCtrlStateUpdate(PlayerControlEvent.Load);
|
||||||
|
loadingTimer.stop();
|
||||||
|
|
||||||
if (player.getAutoplay()) {
|
if (player.getAutoplay()) {
|
||||||
// Subtitles break when seeking post stream initialization for the DASH player.
|
// Subtitles break when seeking post stream initialization for the DASH player.
|
||||||
|
@ -779,7 +778,7 @@ function setIdleScreenVisible(visible: boolean, loading: boolean = false, messag
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
idleIcon.style.display = 'none';
|
idleIcon.style.display = 'none';
|
||||||
loadingSpinner.style.display = 'block';
|
loadingTimer.start();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
idleIcon.style.display = 'block';
|
idleIcon.style.display = 'block';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue