@livestorm/deckcraft-player
v0.1.0
Published
DeckCraft player for the browser: renders .pptx decks in a Web Worker (WebAssembly), with the deck's media played in the page
Keywords
Readme
@livestorm/deckcraft-player
The DeckCraft player built for the browser: a .pptx / .ppsx deck rendered by WebAssembly in a
Web Worker on an OffscreenCanvas, with the deck's audio and video played in the page's own
elements so they have sound. Built from livestorm/deckcraft,
apps/player-web.
| File | What it is |
| --- | --- |
| worker.js | The worker. Start it from a same-origin blob that calls importScripts(<url of worker.js>) |
| deckcraft_player.js, deckcraft_player_bg.wasm | The wasm-bindgen glue (--target no-modules) and the module the worker loads |
| player.js | A page-side library (ES module) driving the worker, with media overlays |
| fonts/*.ttf, fonts.txt | Metric-compatible stand-ins for Office fonts (Carlito, Caladea, Liberation; OFL, licences beside them) |
The worker's protocol is documented at the top of worker.js. The files are plain assets: serve
them as they are from one folder and pass it as base, or let your bundler give each its own URL
and pass those:
import { DeckcraftPlayer } from '@livestorm/deckcraft-player/player.js'
import workerUrl from '@livestorm/deckcraft-player/worker.js?url'
import glueUrl from '@livestorm/deckcraft-player/deckcraft_player.js?url'
import wasmUrl from '@livestorm/deckcraft-player/deckcraft_player_bg.wasm?url'
import carlito from '@livestorm/deckcraft-player/fonts/Carlito-Regular.ttf?url'
const player = new DeckcraftPlayer(container, { workerUrl, glueUrl, wasmUrl, fonts: [carlito] })
await player.open(deckUrl)The module needs WebAssembly SIMD (Chrome 91, Firefox 89, Safari 16.4).
Dual-licensed under MIT or Apache-2.0; the fonts are under the SIL Open Font License.
