Skip to content

Commit

Permalink
Make Paella hide its UI after 2s already
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasKalbertodt committed Sep 21, 2023
1 parent 9b7138e commit 1c1663d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions frontend/src/typings/paella-core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ declare module "paella-core" {
public skin: Skin;

public unload(): Promise<void>;

hideUiTime: number;
}

export interface InitParams {
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/ui/player/Paella.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useRef } from "react";
import { Config, Manifest, Paella, Source, Stream } from "paella-core";
import { Config, Manifest, Paella, Source, Stream, bindEvent, Events } from "paella-core";
import getBasicPluginsContext from "paella-basic-plugins";
import getZoomPluginContext from "paella-zoom-plugin";

Expand Down Expand Up @@ -112,6 +112,9 @@ const PaellaPlayer: React.FC<PaellaPlayerProps> = ({
getZoomPluginContext(),
],
});
bindEvent(player, Events.PLAYER_LOADED, () => {
player.hideUiTime = 2000;
});

const loadPromise = player.skin.loadSkin("/~assets/paella/theme.json")
.then(() => player.loadManifest());
Expand Down

0 comments on commit 1c1663d

Please sign in to comment.