experimental flash support through ruffle
This commit is contained in:
parent
8b96ea9377
commit
d695dcaff9
|
@ -5,6 +5,7 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
|
||||
<!--server-generated-meta-->
|
||||
<link rel="icon" type="image/png" href="/favicon.png">
|
||||
<script src="/static/js/ruffle.js"></script>
|
||||
</head>
|
||||
<body class="hidden">
|
||||
<noscript>To use Pleroma, please enable JavaScript.</noscript>
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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
|
|
@ -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>
|
|
@ -2,6 +2,10 @@
|
|||
// or the entire service could be just mimetype service that only operates
|
||||
// on mimetypes and not files. Currently the naming is confusing.
|
||||
const fileType = mimetype => {
|
||||
if (mimetype.match(/flash/)) {
|
||||
return 'flash'
|
||||
}
|
||||
|
||||
if (mimetype.match(/text\/html/)) {
|
||||
return 'html'
|
||||
}
|
||||
|
|
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue