Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pleroma-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pleroma
pleroma-fe
Commits
5fdc4a19
Commit
5fdc4a19
authored
3 years ago
by
HJ
Browse files
Options
Downloads
Patches
Plain Diff
whooops dropped my monstercondo
parent
adafae97
No related branches found
No related tags found
1 merge request
!1380
Flash support
Pipeline
#35800
failed
3 years ago
Stage: lint
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/services/ruffle_service/ruffle_service.js
+37
-0
37 additions, 0 deletions
src/services/ruffle_service/ruffle_service.js
with
37 additions
and
0 deletions
src/services/ruffle_service/ruffle_service.js
0 → 100644
+
37
−
0
View file @
5fdc4a19
const
createRuffleService
=
()
=>
{
let
ruffleInstance
=
null
const
getRuffle
=
()
=>
new
Promise
((
resolve
,
reject
)
=>
{
if
(
ruffleInstance
)
resolve
(
ruffleInstance
)
// Ruffle needs these to be set before it's loaded
// https://github.com/ruffle-rs/ruffle/issues/3952
window
.
RufflePlayer
=
{}
window
.
RufflePlayer
.
config
=
{
polyfills
:
false
,
publicPath
:
'
/static/ruffle
'
}
// Currently it's seems like a better way of loading ruffle
// because it needs the wasm publically accessible, but it needs path to it
// and filename of wasm seems to be pseudo-randomly generated (is it a hash?)
const
script
=
document
.
createElement
(
'
script
'
)
// see webpack config, using CopyPlugin to copy it from node_modules
// provided via ruffle-mirror
script
.
src
=
'
/static/ruffle/ruffle.js
'
script
.
type
=
'
text/javascript
'
script
.
onerror
=
(
e
)
=>
{
reject
(
e
)
}
script
.
onabort
=
(
e
)
=>
{
reject
(
e
)
}
script
.
oncancel
=
(
e
)
=>
{
reject
(
e
)
}
script
.
onload
=
()
=>
{
ruffleInstance
=
window
.
RufflePlayer
resolve
(
ruffleInstance
)
}
document
.
body
.
appendChild
(
script
)
})
return
{
getRuffle
}
}
const
RuffleService
=
createRuffleService
()
export
default
RuffleService
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment