experimental flash support through ruffle
This commit is contained in:
parent
8b96ea9377
commit
d695dcaff9
9 changed files with 43 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
import StillImage from '../still-image/still-image.vue'
|
||||
import Flash from '../flash/flash.vue'
|
||||
import VideoAttachment from '../video_attachment/video_attachment.vue'
|
||||
import nsfwImage from '../../assets/nsfw.png'
|
||||
import fileTypeService from '../../services/file_type/file_type.service.js'
|
||||
|
@ -43,6 +44,7 @@ const Attachment = {
|
|||
}
|
||||
},
|
||||
components: {
|
||||
Flash,
|
||||
StillImage,
|
||||
VideoAttachment
|
||||
},
|
||||
|
|
|
@ -117,6 +117,8 @@
|
|||
<!-- eslint-enable vue/no-v-html -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Flash v-if="type === 'flash'" :src="attachment.large_thumb_url || attachment.url" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
16
src/components/flash/flash.js
Normal file
16
src/components/flash/flash.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
const Flash = {
|
||||
props: [
|
||||
'src'
|
||||
],
|
||||
created: function () {
|
||||
this.$nextTick(function () {
|
||||
const ruffle = window.RufflePlayer.newest()
|
||||
const player = ruffle.createPlayer()
|
||||
const container = this.$refs.cunt
|
||||
container.appendChild(player)
|
||||
player.load(this.src)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export default Flash
|
15
src/components/flash/flash.vue
Normal file
15
src/components/flash/flash.vue
Normal file
|
@ -0,0 +1,15 @@
|
|||
<template>
|
||||
<div
|
||||
class="Flash"
|
||||
ref="cunt"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script src="./flash.js"></script>
|
||||
|
||||
<style lang="scss">
|
||||
@import '../../_variables.scss';
|
||||
.Flash {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
Loading…
Add table
Add a link
Reference in a new issue