Skip to content

Commit

Permalink
without contentelementBar
Browse files Browse the repository at this point in the history
  • Loading branch information
KalliSfak committed Oct 17, 2023
1 parent e2b9a5d commit aded938
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
<template>
<div>
<ContentElementBar class="menu">
<template #title>
<audio
controls
ref="audioRef"
class="audio"
loading="lazy"
:src="src"
v-on:error="onError"
/>
</template>
<template #menu><slot></slot></template>
</ContentElementBar>
ar
<template>
<audio
controls
ref="audioRef"
class="audio"
loading="lazy"
:src="src"
v-on:error="onError"
/>
</template>

<template class="menu"><slot></slot></template>
</div>
</template>

<script lang="ts">
import { ContentElementBar } from "@ui-board";
import { defineComponent } from "vue";
import { FileAlert } from "../../../shared/types/FileAlert.enum";
export default defineComponent({
name: "VideoDisplay",
name: "AudioDisplay",
props: {
src: { type: String, required: true },
},
components: { ContentElementBar },
emits: ["error"],
setup(props, { emit }) {
const onError = () => {
Expand All @@ -36,3 +34,14 @@ export default defineComponent({
},
});
</script>
<style scoped>
.audio {
width: 85%;
padding: 10px;
}
.menu {
position: absolute;
top: 0;
right: 0;
}
</style>
2 changes: 1 addition & 1 deletion src/utils/fileHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@ export function isVideoMimeType(mimeType: string): boolean {
}

export function isAudioMimeType(mimeType: string): boolean {
return mimeType.startsWith("audio/");
return mimeType.startsWith("audio/") || mimeType === "application/ogg";
}

0 comments on commit aded938

Please sign in to comment.