A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
fix(export): an exported web game's long music plays — its CSP allows blob: media
yhhc7d8eb8daf77
diff --git a/desktop b/desktopindex 664420714..3f27ade5f 160000--- a/desktop+++ b/desktop@@ -1 +1 @@-Subproject commit 6644207149d463795588e099cb0ef05772ca1933+Subproject commit 3f27ade5fb58425140886aca2c06b8c5abffe7c8diff --git a/pipeline/src/export/exportGame.ts b/pipeline/src/export/exportGame.tsindex 79f7d8301..f30c05b08 100644--- a/pipeline/src/export/exportGame.ts+++ b/pipeline/src/export/exportGame.ts@@ -362,7 +362,10 @@ function indexHtml(// incompatible with the standalone page's same-origin resource restriction.const channelPolicy = webChannel === 'poki' || webChannel === 'crazygames' || webChannel === 'youtube'? `default-src 'self' data: blob: https:; script-src 'self' 'unsafe-eval' blob: https: ${inlineScripts}; style-src 'self' 'unsafe-inline' https:; img-src 'self' data: blob: https:; connect-src 'self' data: blob: https:${connect}; frame-src https:; media-src 'self' data: blob: https:; worker-src 'self' blob:;`- : `default-src 'self'; script-src 'self' 'unsafe-eval' blob: ${inlineScripts}; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; connect-src 'self' data: blob:${connect}; worker-src 'self' blob:;`;+ // media-src: a long clip streams through an <audio> element over a blob: URL of its+ // compressed bytes (WebAudioBackend), and `default-src 'self'` alone refuses that+ // source — the music of every exported web game past 30 s stayed silent.+ : `default-src 'self'; script-src 'self' 'unsafe-eval' blob: ${inlineScripts}; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; media-src 'self' data: blob:; connect-src 'self' data: blob:${connect}; worker-src 'self' blob:;`;return `<!doctype html><html lang="en" data-web-channel="${webChannel === 'poki' ? 'poki' : webChannel === 'crazygames' ? 'crazygames' : webChannel === 'youtube' ? 'youtube' : 'standalone'}"><head>