aboutsummaryrefslogtreecommitdiff
path: root/src/components/flash/flash.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2021-04-13 00:08:17 +0300
committerHenry Jameson <me@hjkos.com>2021-04-13 00:08:17 +0300
commit09ef284af7e0c9312cf9968deefe8fe701387689 (patch)
tree29d03f7f7054056036bdaabb617b76d63a906c54 /src/components/flash/flash.js
parent87903fbf6dd8fbc47fe5a49b901aa295e07529e8 (diff)
better label, better error handling
Diffstat (limited to 'src/components/flash/flash.js')
-rw-r--r--src/components/flash/flash.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/components/flash/flash.js b/src/components/flash/flash.js
index 74ea3400..d03384c7 100644
--- a/src/components/flash/flash.js
+++ b/src/components/flash/flash.js
@@ -1,9 +1,13 @@
import RuffleService from '../../services/ruffle_service/ruffle_service.js'
import { library } from '@fortawesome/fontawesome-svg-core'
-import { faStop } from '@fortawesome/free-solid-svg-icons'
+import {
+ faStop,
+ faExclamationTriangle
+} from '@fortawesome/free-solid-svg-icons'
library.add(
- faStop
+ faStop,
+ faExclamationTriangle
)
const Flash = {
@@ -17,7 +21,7 @@ const Flash = {
},
methods: {
openPlayer () {
- if (this.player) return // prevent double-loading
+ if (this.player) return // prevent double-loading, or re-loading on failure
this.player = 'hidden'
RuffleService.getRuffle().then((ruffle) => {
const player = ruffle.newest().createPlayer()
@@ -30,6 +34,9 @@ const Flash = {
player.style.height = '100%'
player.load(this.src).then(() => {
this.player = true
+ }).catch((e) => {
+ console.error('Error loading ruffle', e)
+ this.player = 'error'
})
this.ruffleInstance = player
})