try to make audio play

This commit is contained in:
Martin Drechsel
2025-05-16 08:52:04 +02:00
parent ad3aa4293a
commit 6a1351752b
9 changed files with 250 additions and 1218 deletions

View File

@ -1,33 +1,46 @@
<template>
<div class="w-full h-full overflow-scroll bg-red-300">
<div>
<div class="w-full h-full overflow-scroll">
<!-- <div>
{{ iframeSrc }}
</div>
</div> -->
<iframe
v-if="iframeSrc"
class="w-full h-full"
@load=""
ref="iFrameRef"
:src="iframeSrc"
:src="iframeIndex"
sandbox="allow-scripts allow-same-origin"
allow="autoplay; speaker-selection; encrypted-media;"
>
</iframe>
<!-- <p v-else>{{ t("loading") }}</p> -->
<audio controls :src="audioTest">
Dein Browser unterstützt das Audio-Element nicht.
</audio>
</div>
</template>
<script setup lang="ts">
definePageMeta({
name: "haexExtension",
});
name: 'haexExtension',
})
const { t } = useI18n();
const iframeRef = useTemplateRef("iFrameRef");
const { t } = useI18n()
const iframeRef = useTemplateRef('iFrameRef')
const { extensionEntry: iframeSrc, currentExtension } = storeToRefs(
useExtensionsStore()
)
const audioTest = computed(() => `${iframeSrc.value}/sounds/music/demo.mp3`)
watch(audioTest, () => console.log('audioTest', audioTest.value), {
immediate: true,
})
const { extensionEntry: iframeSrc, currentExtension } = storeToRefs(useExtensionsStore());
const extensionStore = useExtensionsStore();
const iframeIndex = computed(() => `${iframeSrc.value}/index.html`)
const extensionStore = useExtensionsStore()
watch(iframeSrc, () => console.log("iframeSrc", iframeSrc.value), { immediate: true });
watch(iframeSrc, () => console.log('iframeSrc', iframeSrc.value), {
immediate: true,
})
onMounted(async () => {
/* const minfest = await extensionStore.readManifestFileAsync(
@ -35,7 +48,7 @@ onMounted(async () => {
currentExtension.value!.version
);
console.log("manifest", minfest, extensionStore.extensionEntry); */
});
})
</script>
<i18n lang="yaml">