Skip to content

Support wasm target#33

Merged
Him188 merged 3 commits into
mainfrom
codex/wasm-browser-player-preview
May 15, 2026
Merged

Support wasm target#33
Him188 merged 3 commits into
mainfrom
codex/wasm-browser-player-preview

Conversation

@Him188
Copy link
Copy Markdown
Member

@Him188 Him188 commented May 15, 2026

Summary

Adds wasm/browser support for MediaMP by wiring wasmJs targets into the public modules and introducing a browser-backed WebMediampPlayer implementation based on HTMLVideoElement.

This also adds a Compose wasm preview app so consumers can try playback directly in the browser.

Changes

  • Add wasmJs { browser() } targets for mediamp-api, mediamp-source-ktxio, mediamp-test, and mediamp-all.
  • Add wasm actuals for player factory loading and MediampPlayerSurface.
  • Add WebMediampPlayer with URI playback, seek, play/pause/stop/close, progress and media properties, subtitles, volume/mute, playback speed, aspect-ratio controls, and media metadata.
  • Add wasm tests for factory creation, media source setup, subtitle track installation, feature controls, and stop/close behavior.
  • Add mediamp-web-preview for browser validation and manual preview.
  • Keep the existing public UI-thread annotation surface as androidx.annotation.UiThread; no new MediaMP-owned public UiThread annotation is introduced.

User impact

Consumers targeting Compose Web / wasm can now depend on MediaMP and render a player surface in browser apps. Playback uses browser-native media support, so codec support, CORS, Range requests, and autoplay behavior follow the browser's HTMLVideoElement rules.

Validation

  • ./gradlew :mediamp-api:wasmJsTest :mediamp-test:wasmJsTest :mediamp-source-ktxio:compileKotlinWasmJs :mediamp-all:compileKotlinWasmJs :mediamp-web-preview:wasmJsBrowserDevelopmentWebpack --no-daemon --console=plain -Pkotlin.daemon.jvmargs=-Xmx8g
  • ./gradlew :mediamp-web-preview:compileKotlinWasmJs --no-daemon --console=plain
  • Browser validation with Chrome against http://localhost:8080/: located the shadow-DOM <video>, confirmed default MP4 playback, readyState=4, currentTime advanced from 0 to about 2.46s, video size was 960x540, and one subtitle track was installed.

@Him188 Him188 marked this pull request as ready for review May 15, 2026 05:43
@Him188 Him188 force-pushed the codex/wasm-browser-player-preview branch from 50b3e3b to 8fd5baf Compare May 15, 2026 05:53
@Him188 Him188 marked this pull request as draft May 15, 2026 05:53
@Him188 Him188 marked this pull request as ready for review May 15, 2026 06:08
@Him188 Him188 changed the title [codex] Add wasm browser player preview Support wasm target May 15, 2026
@Him188 Him188 merged commit 9ae2036 into main May 15, 2026
4 checks passed
@Him188 Him188 deleted the codex/wasm-browser-player-preview branch May 15, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant