Commit Graph

307 Commits

Author SHA1 Message Date
Mike Welsh f983af3f65 web: Fix decoding of PCM sounds 2020-01-15 21:12:45 -08:00
Mike Welsh ad719ad586 web: Fix timing of sound envelopes
The endTime parameter of AudioParam.linearRampToValueAtTime is
on the global AudioContext's timeline, not local to the sound.
Adding the sound's start time to the parameter fixes sound
envelopes not playing back correctly.
2020-01-15 20:38:43 -08:00
Mike Welsh 12ee4c7432 web: Duplicate left channel when playing a mono sound with envelope (fix #323) 2020-01-15 20:36:05 -08:00
Mike Welsh b57c827e23 web: Use proper key code for Enter key 2020-01-14 16:18:42 -08:00
Mike Welsh 0e228441e1 web: Add missing returns to RufflePlayer.local/local_compatible 2020-01-13 12:28:30 -08:00
Mike Welsh 79745feef7 chore: Use percent-encoding 2.1.0 2020-01-13 11:07:30 -08:00
dependabot-preview[bot] 52607d4706 build(deps): bump url from 2.1.0 to 2.1.1
Bumps [url](https://github.com/servo/rust-url) from 2.1.0 to 2.1.1.
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 10:41:41 -08:00
David Wendt 51023145c8 Build the extension using webpack, the same as the local version. 2020-01-10 22:10:43 -05:00
dependabot-preview[bot] 102c4f9b03 build(deps): bump png from 0.15.2 to 0.15.3
Bumps [png](https://github.com/image-rs/image-png) from 0.15.2 to 0.15.3.
- [Release notes](https://github.com/image-rs/image-png/releases)
- [Changelog](https://github.com/image-rs/image-png/blob/master/CHANGES.md)
- [Commits](https://github.com/image-rs/image-png/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-07 18:35:51 +00:00
dependabot-preview[bot] 0458884f08 build(deps): bump wasm-bindgen-test from 0.3.6 to 0.3.7
Bumps [wasm-bindgen-test](https://github.com/rustwasm/wasm-bindgen) from 0.3.6 to 0.3.7.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-07 08:50:01 +00:00
Mike Welsh ab63f221ed web: Bump to wasm-bindgen 0.2.57 2020-01-06 13:01:39 -08:00
Mike Welsh f576a39760 web: Fix must_use warning on AudioContext::decode_audio_data
web-sys 0.3.34 added `must_use` to `Promise`. Add `let _ =` to
squlech this warning.
2020-01-06 13:01:39 -08:00
dependabot-preview[bot] 5c4a180913 build(deps): bump web-sys from 0.3.33 to 0.3.34
Bumps [web-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.33 to 0.3.34.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-06 13:01:39 -08:00
Mike Welsh 4bf29f677f avm1: Implement Sound.duration
Add AudioBackend::get_sound_duration.
2020-01-03 17:11:00 -08:00
Mike Welsh d0142f1d67 audio: Add AudioBackend::stop_sound 2020-01-03 17:11:00 -08:00
dependabot-preview[bot] b4a47e17da build(deps): bump generational-arena from 0.2.6 to 0.2.7
Bumps [generational-arena](https://github.com/fitzgen/generational-arena) from 0.2.6 to 0.2.7.
- [Release notes](https://github.com/fitzgen/generational-arena/releases)
- [Changelog](https://github.com/fitzgen/generational-arena/blob/master/CHANGELOG.md)
- [Commits](https://github.com/fitzgen/generational-arena/compare/0.2.6...0.2.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-03 19:14:43 +00:00
dependabot-preview[bot] 353dc5c229 build(deps-dev): bump webpack from 4.41.4 to 4.41.5 in /web/selfhosted
Bumps [webpack](https://github.com/webpack/webpack) from 4.41.4 to 4.41.5.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v4.41.4...v4.41.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-03 08:25:48 +00:00
Mike Welsh 87158647d1 core: Implement keyPress button events 2019-12-24 03:06:03 -08:00
Mike Welsh 30983c5bab web: Use pointer events on web 2019-12-23 13:16:58 -08:00
dependabot-preview[bot] db8e0bd997 build(deps): bump wasm-bindgen-test from 0.3.5 to 0.3.6
Bumps [wasm-bindgen-test](https://github.com/rustwasm/wasm-bindgen) from 0.3.5 to 0.3.6.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-23 19:39:55 +00:00
Nathan Adams 9000451d58 core: Implemented Mouse.show() & Mouse.hide() 2019-12-22 14:33:46 -08:00
Mike Welsh c05b03dd06 web: Handle keydown/keyup and preventDefault if Ruffle has focus 2019-12-21 19:08:06 -08:00
David Wendt 69094b56b5 Add input support to the web backend. 2019-12-21 19:08:06 -08:00
Nathan Adams eedc4bbe24 core: Added Input backend, currently unimplemented, for polling user input 2019-12-21 19:08:06 -08:00
dependabot-preview[bot] 4aebeab577 build(deps): bump web-sys from 0.3.32 to 0.3.33
Bumps [web-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.32 to 0.3.33.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-20 18:36:15 +00:00
dependabot-preview[bot] f84bfae010 build(deps-dev): bump webpack-dev-server in /web/selfhosted
Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 3.9.0 to 3.10.1.
- [Release notes](https://github.com/webpack/webpack-dev-server/releases)
- [Changelog](https://github.com/webpack/webpack-dev-server/blob/v3.10.1/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-server/compare/v3.9.0...v3.10.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-19 09:29:07 -08:00
dependabot-preview[bot] d1f258e71e build(deps-dev): bump webpack from 4.41.3 to 4.41.4 in /web/selfhosted
Bumps [webpack](https://github.com/webpack/webpack) from 4.41.3 to 4.41.4.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v4.41.3...v4.41.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-19 16:21:31 +00:00
dependabot-preview[bot] d2cf865ebf build(deps-dev): bump webpack from 4.41.2 to 4.41.3 in /web/selfhosted
Bumps [webpack](https://github.com/webpack/webpack) from 4.41.2 to 4.41.3.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v4.41.2...v4.41.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-16 17:55:53 +00:00
dependabot-preview[bot] 251fb01572 build(deps): bump jpeg-decoder from 0.1.17 to 0.1.18
Bumps [jpeg-decoder](https://github.com/image-rs/jpeg-decoder) from 0.1.17 to 0.1.18.
- [Release notes](https://github.com/image-rs/jpeg-decoder/releases)
- [Changelog](https://github.com/image-rs/jpeg-decoder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/image-rs/jpeg-decoder/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-11 18:21:42 +00:00
Mike Welsh 23ca66a7e3 avm1: Use enum_trait_object for avm1::Object 2019-12-10 01:36:01 -08:00
Mike Welsh f9841fbaa3 web: Update npm dependencies 2019-12-09 16:16:42 -08:00
dependabot-preview[bot] 86c0fa327b build(deps): bump jpeg-decoder from 0.1.16 to 0.1.17
Bumps [jpeg-decoder](https://github.com/image-rs/jpeg-decoder) from 0.1.16 to 0.1.17.
- [Release notes](https://github.com/image-rs/jpeg-decoder/releases)
- [Changelog](https://github.com/image-rs/jpeg-decoder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/image-rs/jpeg-decoder/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-09 17:39:42 +00:00
dependabot-preview[bot] a1cf2d3ab8 build(deps): bump png from 0.15.1 to 0.15.2
Bumps [png](https://github.com/image-rs/image-png) from 0.15.1 to 0.15.2.
- [Release notes](https://github.com/image-rs/image-png/releases)
- [Changelog](https://github.com/image-rs/image-png/blob/master/CHANGES.md)
- [Commits](https://github.com/image-rs/image-png/compare/v0.15.1...v0.15.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-04 07:07:57 +00:00
Mike Welsh 29754eace8 web: Avoid `copyToChannel` on Safari
`AudioBuffer.copyToChannel` does not work on Safari, so switch to
using `getChannelData` to fill the audio buffers.

Limitations in wasm-bindgen prevent us from actually modifying the
data returned by `getChannelData` on the Rust side, so import a JS
function to fill the audio buffer (js-src/ruffle-imports.js).
2019-12-03 23:05:42 -08:00
Mike Welsh 9a258e9b51 web: Default demo build to production mode 2019-11-25 17:00:29 -08:00
Mike Welsh 42d724292f extension: Add missing obfuscated_event_prefix 2019-11-25 17:00:29 -08:00
Mike Welsh 24bf3a49bb extension: Fix webpack config to build even if web demo hasn't been built. Fix #122 2019-11-25 17:00:29 -08:00
Nathan Adams 35d80a254b chore: Use new method of setting png color & depth 2019-11-25 10:39:01 +00:00
dependabot-preview[bot] aa61516c1d build(deps): bump png from 0.14.1 to 0.15.1
Bumps [png](https://github.com/image-rs/image-png) from 0.14.1 to 0.15.1.
- [Release notes](https://github.com/image-rs/image-png/releases)
- [Changelog](https://github.com/image-rs/image-png/blob/master/CHANGES.md)
- [Commits](https://github.com/image-rs/image-png/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-25 10:39:01 +00:00
dependabot-preview[bot] 9d93669e9e build(deps): bump svg from 0.5.12 to 0.6.0
Bumps [svg](https://github.com/bodoni/svg) from 0.5.12 to 0.6.0.
- [Release notes](https://github.com/bodoni/svg/releases)
- [Commits](https://github.com/bodoni/svg/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-20 18:38:58 +00:00
Mike Welsh 28518f5e54 web: Use new polyfill API in demo 2019-11-19 14:57:32 -08:00
dependabot-preview[bot] fbf58f2fda build(deps): bump wasm-bindgen-test from 0.2.50 to 0.3.5
Bumps [wasm-bindgen-test](https://github.com/rustwasm/wasm-bindgen) from 0.2.50 to 0.3.5.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-19 19:53:11 +00:00
dependabot-preview[bot] 356ede4003 build(deps): bump web-sys from 0.3.31 to 0.3.32
Bumps [web-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.31 to 0.3.32.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-19 19:39:00 +00:00
dependabot-preview[bot] f834826fa2 build(deps): bump base64 from 0.10.1 to 0.11.0
Bumps [base64](https://github.com/marshallpierce/rust-base64) from 0.10.1 to 0.11.0.
- [Release notes](https://github.com/marshallpierce/rust-base64/releases)
- [Changelog](https://github.com/marshallpierce/rust-base64/blob/master/RELEASE-NOTES.md)
- [Commits](https://github.com/marshallpierce/rust-base64/compare/v0.10.1...v0.11.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-19 19:07:57 +00:00
Mike Welsh 9f85686666 web: Add missing return to VersionRange.from_requirement_string 2019-11-17 17:43:19 -05:00
Mike Welsh f41708a584 web: Add missing return to Ruffle.newest() 2019-11-17 17:43:19 -05:00
David Wendt 5d8d02a5a2 Add `local` and `local_compatible` methods to the Public API. 2019-11-17 17:43:19 -05:00
David Wendt ab9af6958e Enforce the opt-out entirely within trusted extension space, so that we don't load any untrusted world code at all in that case. 2019-11-17 17:43:19 -05:00
David Wendt 5aab97053b Don't depend on the legacy elements polyfill anymore, as that no longer exists, and we define all elements on demand. 2019-11-17 17:43:19 -05:00
David Wendt d964afe72e Expose the `RufflePlayer` element directly. 2019-11-17 17:43:19 -05:00
David Wendt 75e00aff7b Allow looking up sources directly by version. 2019-11-17 17:43:19 -05:00
David Wendt 99714d445c Expand version handling to support ranges and requirements. 2019-11-17 17:43:19 -05:00
David Wendt 3b1ab0e987 Fix the fallback object detection. 2019-11-17 17:43:19 -05:00
David Wendt 5b5aaecb83 Interdictions are now called polyfills 2019-11-17 17:43:19 -05:00
David Wendt 2fa42e3b31 Allow fault tolerance for naming conflicts with Ruffle elements 2019-11-17 17:43:19 -05:00
David Wendt d53f9c8f47 Allow configuring the Webpack path 2019-11-17 17:43:19 -05:00
David Wendt fbca5a0a6f Fix broken interdictions 2019-11-17 17:43:19 -05:00
David Wendt ccd763b696 Tolerate Ruffle loading after the page loads 2019-11-17 17:43:19 -05:00
David Wendt 6d34997975 Fix some bugs in the Public API 2019-11-17 17:43:19 -05:00
David Wendt 4163ea7975 Add the ability to upgrade the Public API itself.
This isn't intended to be used right away.
2019-11-17 17:43:19 -05:00
David Wendt 6b0881e3f2 Add proper version negotiation 2019-11-17 17:43:19 -05:00
David Wendt db01ee8984 Add class to parse version strings 2019-11-17 17:43:19 -05:00
David Wendt bb184469d8 Actually install new sources 2019-11-17 17:43:19 -05:00
David Wendt f957ec4744 Create a standard list of interdictions rather than checking for specific strings. 2019-11-17 17:43:19 -05:00
David Wendt d1aa71e488 Add explicit classes for the Ruffle Public API. 2019-11-17 17:43:19 -05:00
David Wendt 5dcbe43fe1 Consolidate public API into a shared module 2019-11-17 17:43:19 -05:00
David Wendt 8d29af6d49 Configure selfhosted Ruffle to also create a RufflePlayer API. 2019-11-17 17:43:19 -05:00
David Wendt 4742baf40d Make interdictions configured via a window object call 2019-11-17 17:43:18 -05:00
David Wendt 8d9f1ec237 Opt the demo page out of Ruffle 2019-11-17 17:43:18 -05:00
David Wendt 48fd6cc7a7 Fix declarative configuration reader 2019-11-17 17:43:18 -05:00
David Wendt fbb818d22a Fix the names of the JS parts of Ruffle. 2019-11-17 17:43:18 -05:00
David Wendt 485f166df3 Add data attributes to declaratively control Ruffle. 2019-11-17 17:43:18 -05:00
David Wendt fe782e5db3 Create a third web target: "selfhosted".
Currently, selfhosted just omits some of the crazier interdictions.
2019-11-17 17:43:18 -05:00
Mike Welsh e3d0d9031d core: Handle empty JPEGTables tags (fix #116) 2019-11-11 17:08:08 -05:00
Mike Welsh b343ba14a2 web: Implement event sound envelopes 2019-10-30 19:26:19 -07:00
Mike Welsh 158f2a6fa2 web: Use SeekSamples to account for MP3 encoder delay 2019-10-29 23:36:51 -07:00
Mike Welsh f9b23c6e0c web: Handle gaps between SoundStreamBlocks 2019-10-29 23:36:51 -07:00
Mike Welsh 1a7959b96d audio: Initial syncing of stream sound to MovieClip timeline 2019-10-29 23:36:51 -07:00
Mike Welsh f07dfb4eb6 web: Implement ADPCM stream sounds on web 2019-10-28 02:51:46 -07:00
Mike Welsh eaea6aaf20 audio: Fix audio for ADPCM stream sounds
When a stream sound uses ADPCM compression, the ADPCM header is
included in each SoundStreamBlock (as opposed to stream sounds
in the other formats). This header wasn't being parsed, resulting
in corrupted audio (see https://homestarrunner.com/main12.swf).
2019-10-28 02:51:46 -07:00
Mike Welsh 4aec120ffb core: Add Bitmap display object
Converts the Bitmap character to a proper display object. This can
be instantiated directly in a PlaceObject tag in SWFv9 movies,
compared to the previous versions which indirectly references
bitmaps from Shape tags.
2019-10-11 16:33:58 -07:00
Mike Welsh 0506b7c566 web: Calculate bounds for text glyphs when not present
The text bounds fields for a DefineFont2/3 tag can be a bogus empty
rectangle, per the SWF spec. We must properly the bounds ourselves
to render properly on web.
2019-10-07 23:23:45 -07:00
Mike Welsh c408f56e1a web: Fix looping sounds not ending 2019-10-03 16:30:33 -07:00
Mike Welsh c2ddb5a26f web: Clamp stroke width to 1 pixel minimum
Many SWFs use "hairline" strokes which are 1 twip wide, but Flash
renders strokes with a minimum width of 1 pixel (20 twips).
SVG has no minimum, resulting in faint lines for the "hairline"
strokes. Clamp the minimum stroke width to 1 pixel to more closely
match the Flash Player.
2019-10-03 03:15:10 -07:00
Mike Welsh c1f521cfba web: Fix color transforms not working when canvas is reused
On the web demo, if you played two different SWFs, color transforms
would stop working because the color matrix SVG filter would be
created twice with the same ID. Now we properly remove the previous
filter.
2019-09-27 16:20:25 -07:00
Mike Welsh fcfcf0407d core: Fix stop sound events 2019-09-27 13:50:03 -07:00
Mike Welsh 9fc18fdb6a web: Clean up web audio backend
Change naming to more closely match the desktop backend.
2019-09-27 13:50:03 -07:00
Mike Welsh af163d9183 core: Support start, stop, event sounds in audio backend
Event sounds on the timeline in Flash have a "sync" setting,
which allows them to stop other sounds or only play if the
sound is not already playing.
2019-09-27 13:50:03 -07:00
Mike Welsh 547da84c9c core: Add stop_all_sounds to audio backend
Implemented in web and desktop.
2019-09-19 00:47:05 -07:00
Mike Welsh 1f0e43c3bd web: Support event sound looping and start/end points 2019-09-19 00:47:05 -07:00
Mike Welsh e052a70a5a desktop: Support looping and start/end points for event sounds
Renamed `AudioBackend::play_sound` to `start_sound`, and this
also takes a `SoundInfo` parameter with the event sound settings
from the SWF file.

Desktop now obeys the loop and start/end point settings. Envelopes
are still TODO.
2019-09-19 00:47:05 -07:00
Mike Welsh 9c8721c127 core: Drop rodio and use only cpal for audio backend
Drop the rodio dependency and directly use cpal for the audio
backend. Use the sample crate for audio mixing and resampling.
2019-09-19 00:47:05 -07:00
Mike Welsh 3b5820f365 webdemo: Add min-height to nav bar for Safari 2019-09-17 23:29:21 -07:00
Mike Welsh 82c1116c42 chore: cargo fmt 2019-09-16 20:37:11 -07:00
David Wendt 58ce10ea67 Support form submission from Flash. 2019-09-16 20:04:30 -07:00
David Wendt e952d20976 Open the window asked for, if specified 2019-09-16 20:04:30 -07:00
David Wendt 0f9db1744b Add a backend for controlling the enclosing web browser. 2019-09-16 20:04:30 -07:00
David Wendt 4502ad54c2 Allow dynamic interdiction to apply to object/embed tags directly 2019-09-14 15:15:26 -05:00
David Wendt a942eb3ab2 Support data parameter for SWF url. 2019-09-14 15:15:26 -05:00
Mike Welsh dbbeccaacd web: More accurate radial gradients on canvas 2019-09-12 01:02:46 -07:00
David Wendt 84759f8cea Fix our previous changes to the Ruffle core loader so that both the extension and demo work 2019-09-11 20:28:58 -04:00
Mike Welsh 8fcee704c0 chore: cargo fmt 2019-09-09 20:42:08 -05:00
Mike Welsh ce9a0a8ef6 web: Initial masking support
Also add web/src/utils.rs for some methods to ease management
of errors for wasm_bindgen.
2019-09-09 20:42:08 -05:00
Mike Welsh 28f0ce3c83 Mask work 2019-09-09 20:42:08 -05:00
David Wendt 287870ec03 Get rid of the superfluous bootstrap file as it appears to be causing Webpack problems 2019-09-04 23:16:44 -04:00
Mike Welsh 1ff86012ae chore: Fix jpeg-decoder warnings in Cargo.toml 2019-09-04 15:56:10 -07:00
David Wendt f59d62516e Fix demo site regressions. 2019-09-03 18:38:05 -04:00
David Wendt 9dd01494f3 build.sh should be executable 2019-09-01 11:49:27 -06:00
David Wendt 406cc746ce The MimeType for `application/x-shockwave-flash` should list it's extension as `swf`, not `spl`. 2019-08-31 18:57:26 -04:00
David Wendt fc67f0872f Don't break Ruffle if we encounter an embed or object without a size. 2019-08-30 22:27:51 -04:00
David Wendt adc1a79155 Place the extension related build system back .
Built extension files now live in `web/extension/build`.
2019-08-30 22:27:51 -04:00
David Wendt b4b38057e4 Add checks for the Ruffle element being connected.
When a Ruffle player element is disconnected, attempts to play SWF files
fail semi-silently.

We also check for nested objects, since only the top should be
successful in loading.
2019-08-30 22:27:50 -04:00
David Wendt f01f479f54 Don't forget random bits of object tag contents! 2019-08-30 22:27:50 -04:00
David Wendt 2b2f27afad Falsify a better-sounding version of Flash.
This is at least the version Chrome claims to have.
2019-08-30 22:27:50 -04:00
David Wendt 0d8b72acce Don't try to wrap text nodes, it won't end well. 2019-08-30 22:27:50 -04:00
David Wendt 190666fe91 Interdict Flash tags that use ActiveX. 2019-08-30 22:27:50 -04:00
David Wendt 21454b327b Fix incorrect centering on homestarrunner.net its dot com 2019-08-30 22:27:49 -04:00
David Wendt 61171037cd Recognize really old FutureSplash era tags as Flash 2019-08-30 22:27:49 -04:00
David Wendt 9ec4892ae7 Fix regression caused by the extension file move 2019-08-30 22:27:49 -04:00
David Wendt de00145755 Add icons for the extension 2019-08-30 22:27:49 -04:00
David Wendt cdf50e29bd Move the build system and package files out of the extension directory.
This keeps the node_modules out of the extension package.
2019-08-30 22:27:49 -04:00
David Wendt ce5ab95a9a Compatibility with Chrome's extension environment 2019-08-30 22:27:48 -04:00
David Wendt fa5a3164ea should be executable on unixlikes 2019-08-30 22:27:48 -04:00
David Wendt c02b4c111b Overwrite navigator.plugins to defeat flash detects 2019-08-30 22:27:48 -04:00
David Wendt 101b1e5715 Fix not being able to handle multiple embeds.
This is caused by `HTMLCollection` being too smart for it's own good and
removing elements behind the loop's back.
2019-08-30 22:27:48 -04:00
David Wendt 6fbdc6f1f4 Respect the page's width and height settings in our custom elements 2019-08-30 22:27:47 -04:00
David Wendt 8060802465 Kill `bootstrap.js`, load the WASM ourselves.
Instead of forcing a chunk load on Webpack just so we can have Webpack prepare the WASM for us, we're now using the `no-modules` mode of `wasm-pack` manually and loading the resulting files ourselves.

I still have to force Ruffle to load outside of the extension sandbox though...
2019-08-30 22:27:47 -04:00
David Wendt 7c6ad57443 Let's completely force webpack to run outside of the extension sandbox.
This idea was stolen from @devsnek, whom I'm currently writing an explanation for.
2019-08-30 22:27:47 -04:00
David Wendt 7a6169275d Tell webpack about the extension resource URLs 2019-08-30 22:27:47 -04:00
David Wendt 385b9f807e Fix most (though not all) of our extension bugs.
I still can't figure out how to keep Webpack from making requests to the
injected site...
2019-08-30 22:27:47 -04:00
David Wendt de5a2c31c0 Add embed support. 2019-08-30 22:27:47 -04:00
David Wendt 9529893437 Add console error logging for failed SWF loads 2019-08-30 22:27:46 -04:00
David Wendt ee8b6d57ba Don't pull params until after we've been connected.
Otherwise, we don't have any params yet...
2019-08-30 22:27:46 -04:00
David Wendt 5655ad44a3 It turns out, we don't need to wait for DOMContentLoaded. 2019-08-30 22:27:46 -04:00
David Wendt c0e6866745 Fix the demo file upload option 2019-08-30 22:27:46 -04:00
David Wendt be21a0dbbb Configure the `<ruffle-object>` tag to style as a
block element, like `<object>`
2019-08-30 22:27:45 -04:00
David Wendt 2a2dbba21f Use a custom element to actually house the Ruffle
instance, even though we can't really upgrade `<object>` directly...
2019-08-30 22:27:45 -04:00
David Wendt 6f32fc022c Copy attributes from hijacked Flash objects 2019-08-30 22:27:45 -04:00
David Wendt 0414e24ce2 First start on extension packaging 2019-08-30 22:27:45 -04:00
David Wendt bac5ecfe8d Alter the demo a bit so that it latches onto an
already-existing object tag and replaces it with ruffle.
2019-08-30 22:27:45 -04:00
Mike Welsh 35652ae87e chore: Update dependencies
Run cargo update. Remove git dependency on jpeg-decoder (the latest
version was published to crates.io). Update swf-rs to latest to
disable smoothing in SWFv7 and lower (addresses #28).
2019-08-29 14:57:12 -07:00
Mike Welsh 6a5c5ab1df chore: Add rustfmt.toml and rustfmt pass 2019-08-26 16:38:48 -07:00
Mike Welsh 3a795fff47 web: image-rendering: pixelated for nonsmoothed bitmaps
TODO: Firefox uses crisp-edges, Chrome uses pixelated. Clean this up
at some point.

Addresses #28.
2019-08-24 10:59:56 -05:00
Mike Welsh 324a410cb1 render: Properly render premultiplied alpha bitmaps 2019-08-22 15:24:50 -07:00
Mike Welsh 022a0746ca web: Add hack for Firefox additive alpha cxforms
This hack removes additive alpha components from color transforms
on Firefox. See #38.
2019-08-22 14:13:37 -07:00
Mike Welsh 3933b00000 web: Use initial timestamp from requestAnimationFrame
Previously Performance.now() was used to grab the initial timestamp
for calculating dt in requestAnimationFrame. However, this doesn't
seem to be reliable and resulted in negative dt values in Chrome.

Now we just use an Option for the timestamp and initialize it to None.
The first animation callback will set the timestamp.
2019-08-22 13:28:06 -07:00
Mike Welsh 5fdc7168a7 web: Fix DefineBitsJPEG3 + alpha
DefineBitsJPEG3 tags also include a zlib-encoded alpha channel.
This wasn't working on web (it was trying to use the raw RBGA also
an image!) Now these are re-encoded to PNG.

Addresses #27.
2019-08-20 16:23:46 -07:00
Mike Welsh d021b02e90 web: Disable alpha on canvas 2019-08-19 23:33:12 -07:00
Mike Welsh 9cbeacd7b2 core: Transform mouse coordinates from viewport to stage 2019-08-19 22:27:38 -07:00
Mike Welsh 637588fae5 core: Store view matrix in player
Player is now in charge of scaling/cropping/translating the content
to fit the viewport size supplied by the frontend.

Added backend::render::Letterbox, which stores the margin sizes
for letter/pillarboxing.
2019-08-19 22:27:38 -07:00