Support wasm target#33
Merged
Merged
Conversation
50b3e3b to
8fd5baf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds wasm/browser support for MediaMP by wiring
wasmJstargets into the public modules and introducing a browser-backedWebMediampPlayerimplementation based onHTMLVideoElement.This also adds a Compose wasm preview app so consumers can try playback directly in the browser.
Changes
wasmJs { browser() }targets formediamp-api,mediamp-source-ktxio,mediamp-test, andmediamp-all.MediampPlayerSurface.WebMediampPlayerwith URI playback, seek, play/pause/stop/close, progress and media properties, subtitles, volume/mute, playback speed, aspect-ratio controls, and media metadata.mediamp-web-previewfor browser validation and manual preview.androidx.annotation.UiThread; no new MediaMP-owned publicUiThreadannotation 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
HTMLVideoElementrules.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=plainhttp://localhost:8080/: located the shadow-DOM<video>, confirmed default MP4 playback,readyState=4,currentTimeadvanced from 0 to about 2.46s, video size was960x540, and one subtitle track was installed.