add video and audio creation

This commit is contained in:
axolotle
2021-10-26 16:33:17 +02:00
parent 8b99a8d440
commit 9754527864
2 changed files with 30 additions and 6 deletions
+25 -6
View File
@@ -44,18 +44,26 @@
<b-modal
v-if="creation && creation.iframeUrl"
v-if="creation && (creation.iframeUrl || creation.mediaItem)"
:id="'modal-creation' + creation.id"
class="modal-creation"
static hide-footer hide-header
>
<template #default="{ hide, visible }">
<button-expand expanded @click="hide()" />
<iframe
v-if="visible"
:src="creation.iframeUrl"
width="100%" height="100%"
/>
<template v-if="visible">
<iframe
v-if="creation.iframeUrl"
:src="creation.iframeUrl"
width="100%" height="100%"
/>
<component
v-else-if="creation.mediaItem"
:is="creation.mediaItem.is"
:src="creation.mediaItem.url"
controls
/>
</template>
</template>
</b-modal>
@@ -226,6 +234,7 @@ export default {
&-body {
padding: 0;
display: flex;
}
&-backdrop {
@@ -241,6 +250,16 @@ export default {
top: 0;
right: 0;
}
audio {
width: 80%;
margin: auto;
}
video {
width: 100%;
height: 100%;
}
}
}
</style>
+5
View File
@@ -46,6 +46,11 @@ export default {
node.iframeUrl = node.files[0].url + '#toolbar=0&navpanes=0&statusbar=0'
} else if (mime === 'text/html') {
node.iframeUrl = node.files[0].url
} else if (['audio', 'video'].some(type => mime.includes(type))) {
node.mediaItem = {
is: mime.includes('audio') ? 'audio' : 'video',
src: node.files[0].url
}
} else if (node.piece && node.piece.url) {
node.iframeUrl = node.piece.url
}