From 94bca758ab331f58272d9bb9d0f9ea597473df2b Mon Sep 17 00:00:00 2001 From: mattyatea Date: Thu, 16 May 2024 09:20:28 +0900 Subject: [PATCH] update --- packages/frontend/src/components/MkMediaAudio.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/frontend/src/components/MkMediaAudio.vue b/packages/frontend/src/components/MkMediaAudio.vue index d9247afa24..570569ecd0 100644 --- a/packages/frontend/src/components/MkMediaAudio.vue +++ b/packages/frontend/src/components/MkMediaAudio.vue @@ -101,6 +101,7 @@ import bytes from '@/filters/bytes.js'; import { hms } from '@/filters/hms.js'; import MkMediaRange from '@/components/MkMediaRange.vue'; import { $i, iAmModerator } from '@/account.js'; +import tinycolor from "tinycolor2"; const props = defineProps<{ audio: Misskey.entities.DriveFile; }>(); @@ -243,6 +244,7 @@ const volume = ref(.25); const speed = ref(1); const loop = ref(false); // TODO: ドライブファイルのフラグに置き換える const bufferedEnd = ref(0); +let audioContext = new AudioContext(); // MediaControl Events function togglePlayPause() { @@ -273,7 +275,8 @@ let stopAudioElWatch: () => void; function init() { if (onceInit) return; onceInit = true; - + const computedStyle = getComputedStyle(document.documentElement); + accent.value = tinycolor(computedStyle.getPropertyValue('--accent')).toHexString(); stopAudioElWatch = watch(audioEl, () => { if (audioEl.value) { isReady.value = true; @@ -339,8 +342,6 @@ watch(loop, (to) => { }); onMounted(async () => { - accent.value = tinycolor(getComputedStyle(document.documentElement).getPropertyValue('--accent')); - init(); });