Merge branch 'flash-support' into shigusegubu

* flash-support:
  do not load ruffle multiple times!
  translate a variable name to American English from Australian English
  linting
  whooops dropped my monstercondo
This commit is contained in:
Henry Jameson 2021-04-12 01:16:44 +03:00
commit 21719c4f2d
4 changed files with 22 additions and 10 deletions

View file

@ -118,7 +118,10 @@
</div>
</div>
<Flash v-if="type === 'flash'" :src="attachment.large_thumb_url || attachment.url" />
<Flash
v-if="type === 'flash'"
:src="attachment.large_thumb_url || attachment.url"
/>
</div>
</template>

View file

@ -3,7 +3,7 @@ import { library } from '@fortawesome/fontawesome-svg-core'
import { faStop } from '@fortawesome/free-solid-svg-icons'
library.add(
faStop,
faStop
)
const Flash = {
@ -24,7 +24,7 @@ const Flash = {
player.config = {
letterbox: 'on'
}
const container = this.$refs.cunt
const container = this.$refs.container
container.appendChild(player)
player.style.width = '100%'
player.style.height = '100%'

View file

@ -2,19 +2,25 @@
<div class="Flash">
<div
v-if="player"
ref="cunt"
ref="container"
class="player"
:class="{ hidden: player === 'hidden' }"
/>
<button
v-if="player === false || player === 'hidden'"
@click="openPlayer"
class="button-unstyled placeholder"
@click="openPlayer"
>
<span v-if="player === 'hidden'" class="label">
<span
v-if="player === 'hidden'"
class="label"
>
{{ $t('general.loading') }}
</span>
<span v-else class="label">
<span
v-else
class="label"
>
{{ $t('general.flash_content') }}
</span>
</button>
@ -24,8 +30,8 @@
@click="closePlayer"
>
<FAIcon icon="stop" />
</button>
</div>
</button>
</div>
</template>
<script src="./flash.js"></script>

View file

@ -2,7 +2,10 @@ const createRuffleService = () => {
let ruffleInstance = null
const getRuffle = () => new Promise((resolve, reject) => {
if (ruffleInstance) resolve(ruffleInstance)
if (ruffleInstance) {
resolve(ruffleInstance)
return
}
// Ruffle needs these to be set before it's loaded
// https://github.com/ruffle-rs/ruffle/issues/3952
window.RufflePlayer = {}