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