Skip to content

Commit

Permalink
gui: fix disappeared audio player
Browse files Browse the repository at this point in the history
  • Loading branch information
culdo committed Mar 24, 2024
1 parent 22a0dd5 commit 60c0384
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/modules/gui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ class MMDGui {
_addEventHandlers() {
const { api, camera, composer, renderer, controls, cwHelper, player } = this._mmd
const scope = this._mmd
const button = document.getElementById("button")
const rawPlayer = document.getElementById("button")
const fullScreenBt = document.getElementById("button")
const rawPlayer = document.getElementById("rawPlayer")

player.on('volumechange', () => {
api['volume'] = player.volume();
Expand All @@ -97,7 +97,7 @@ class MMDGui {
player.on('seeked', () => {
api.currentTime = player.currentTime();
})
button.onclick = () => {
fullScreenBt.onclick = () => {
let elem = document.querySelector("body");

if (!document.fullscreenElement) {
Expand All @@ -124,15 +124,15 @@ class MMDGui {
document.addEventListener('mousemove', (e) => {

rawPlayer.style.opacity = "0.5";
button.style.opacity = "0.5";
fullScreenBt.style.opacity = "0.5";
document.body.style.cursor = "default"
if (this._timeoutID !== undefined) {
clearTimeout(this._timeoutID);
}

this._timeoutID = setTimeout(function () {
rawPlayer.style.opacity = "0";
button.style.opacity = "0";
fullScreenBt.style.opacity = "0";
if (!player.paused()) {
document.body.style.cursor = "none"
}
Expand Down

0 comments on commit 60c0384

Please sign in to comment.