Repository navigation
Avalonia GUI in the browser (WebAssembly) - #14
Merged
Merged
Conversation
GetDoubleValue replaced '.' with ',' and parsed with the current culture, which only works where ',' is the decimal separator: on en-US (and in the browser, and on the invariant culture) "25.000" became 25000, so frame rates, aspect ratios and stream size proportions were 1000x off. MediaInfo always emits '.', so parse it invariantly. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SyVioAMhEw3uuqBekTJcn2
SharpMediaInfo.GUI.Avalonia.Browser runs the Avalonia app on the .NET WebAssembly runtime with MediaInfoLib linked into dotnet.native.wasm. Views, controls and converters are the desktop app's, compiled in as linked files; only startup, a single-view MainView and the services that touch files, settings and the browser are new: - files picked or dropped are kept as IStorageFile behind pseudo paths, so the shared view models are unchanged, and read in chunks through Blob.slice (SeekableBlobStream exposes the seeking Avalonia's stream supports but does not advertise), so large videos are never loaded whole and nothing is uploaded; - settings in localStorage; exports through the save picker or a download; - no recent files, shell integration or "open containing folder". The clipboard service also works with a single-view lifetime. CI publishes the site, checks MediaInfoLib was linked and uploads it as the SharpMediaInfo-web artifact; run.sh publishes and serves it locally. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SyVioAMhEw3uuqBekTJcn2
simonebortolin
force-pushed
the
ccr-avalonia-browser
branch
from
November 14, 2026 14:15
8ba5123 to
ad72e45
Compare
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SyVioAMhEw3uuqBekTJcn2
Contributor
|
Pre-release Windows, Linux and macOS desktop builds and NuGet packages of 2ea8b17. Updated on every push, deleted when this PR is closed. |
Releases the browser GUI and the culture-independent decimal parsing fix. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SyVioAMhEw3uuqBekTJcn2
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.
Adds the Avalonia GUI in the browser, built on MediaInfoLib compiled for
browser-wasmand thenet10.0-browserTFM from #13 (already merged).What it does
New project
SharpMediaInfo.GUI.Avalonia.Browser(net10.0-browser, Avalonia.Browser): the same Avalonia GUI, running entirely in the browser as a static site. Files are analysed locally, in chunks: nothing is uploaded.Published on GitHub Pages at every push to
master: https://simonebortolin.github.io/SharpMediaInfo/. This needs a one-time setting: Settings → Pages → Source: GitHub Actions.Architecture
SharpMediaInfo.GUI.Avalonia, hosted in a single-view lifetime (MainView).AvaloniaClipboardServicenow also works without a desktop window.BrowserFileRegistry: maps theIStorageFileobjects from the picker or drag & drop to pseudo-paths, so the existing services keep working with paths.SeekableBlobStream:BlobReadableStream(Avalonia.Browser) reads throughBlob.sliceand supportsSeek(x, Begin), but it declaresCanSeek = false. The wrapper tracks the position itself, and MediaInfo reads only the chunks it needs (it was tested with a moov atom at the end of the file).localStorage. Exports use the save picker where it exists, otherwise they are downloaded.TrimmerRootAssemblyfor CascadiaUI and MsBox.Avalonia: without it, trimming removes their precompiled XAML.Bug fix: decimal values and culture
MediaInfoBuilderconverted decimals withReplace(".", ",")plus the current culture. On en-US this produced values 1000× too large (25.000 fps → 25000). Decimals are now parsed withCultureInfo.InvariantCulture. The new testDecimalValues_AreParsedIndependentlyOfCurrentCulturecovers en-US, it-IT and invariant; it fails without the fix.CI / tooling
test-wasmpublishes the browser GUI, checks thatdotnet.native.*.wasmcontains MediaInfo, and uploads the static site as theSharpMediaInfo-webartifact.pagesjob (master only, aftertestandtest-wasm): deploys that artifact withupload-pages-artifact/deploy-pages. All paths are relative, so the site works under/SharpMediaInfo/. It was verified in Chromium, served under that subpath, with no errors. COOP/COEP headers are not needed.SharpMediaInfo.GUI.Avalonia.Browser/run.sh: publishes and serves locally on127.0.0.1:8080.SharpMediaInfo.slnx(same asSharpMediaInfo.Wasm.Smoke), so opening the solution does not require the wasm workload.Testing
showOpenFilePickerand via the<input>fallback;/SharpMediaInfo/subpath.Known limitations
🤖 Generated with Claude Code
https://claude.ai/code/session_01SyVioAMhEw3uuqBekTJcn2