refactor: use EmbedVideo in creations
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
<div v-if="node.videos">
|
||||
<embed-video
|
||||
v-for="video in node.videos" :key="video.url"
|
||||
:src="video.url" class="mt-3"
|
||||
:src="video.url" type="video" class="mt-3"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
+4
-11
@@ -48,7 +48,7 @@
|
||||
|
||||
|
||||
<b-modal
|
||||
v-if="creation && (creation.iframeUrl || creation.mediaItem)"
|
||||
v-if="creation && creation.mediaItem"
|
||||
:id="'modal-creation' + creation.id"
|
||||
class="modal-creation"
|
||||
static hide-footer hide-header
|
||||
@@ -56,16 +56,9 @@
|
||||
<template #default="{ hide, visible }">
|
||||
<button-expand expanded @click="hide()" />
|
||||
<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.src"
|
||||
controls
|
||||
<embed-video
|
||||
v-bind="creation.mediaItem"
|
||||
full
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<img :src="node.image.url" :alt="node.image.alt">
|
||||
|
||||
<button-expand
|
||||
v-if="node.iframeUrl || node.mediaItem" artwork
|
||||
v-if="node.mediaItem" artwork
|
||||
v-b-modal="'modal-creation' + node.id" class="center"
|
||||
/>
|
||||
|
||||
|
||||
+8
-5
@@ -45,19 +45,22 @@ export default {
|
||||
if (!node.files.length) node.files = null
|
||||
const mime = creationFile.filemime
|
||||
if (mime === 'application/pdf') {
|
||||
node.iframeUrl = creationFile.url + '#toolbar=0&navpanes=0&statusbar=0'
|
||||
node.mediaItem = {
|
||||
type: 'iframe',
|
||||
src: creationFile.url + '#toolbar=0&navpanes=0&statusbar=0'
|
||||
}
|
||||
} else if (mime === 'text/html') {
|
||||
node.iframeUrl = creationFile.url
|
||||
node.mediaItem = { type: 'iframe', src: creationFile.url }
|
||||
} else if (['audio', 'video'].some(type => mime.includes(type))) {
|
||||
node.mediaItem = {
|
||||
is: mime.includes('audio') ? 'audio' : 'video',
|
||||
type: mime.includes('audio') ? 'audio' : 'video',
|
||||
src: creationFile.url
|
||||
}
|
||||
} else if (node.piece && node.piece.url) {
|
||||
node.iframeUrl = node.piece.url
|
||||
node.mediaItem = { type: 'iframe', src: node.piece.url }
|
||||
}
|
||||
} else if (node.piece && node.piece.url) {
|
||||
node.iframeUrl = node.piece.url
|
||||
node.mediaItem = { type: 'iframe', src: node.piece.url }
|
||||
}
|
||||
|
||||
if (node.images && node.images.length) {
|
||||
|
||||
Reference in New Issue
Block a user