GWP desktop player sample#171
Open
alafleur-genetec wants to merge 9 commits intomainfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new WPF + WebView2 sample that hosts the Genetec Web Player (GWP) inside a desktop application, keeping Media Gateway credentials in the native host while the embedded page loads gwp.js from the gateway and requests per-camera tokens via a COM-visible .NET provider.
Changes:
- Introduces a local hosted HTML UI (
app.local) that loadsgwp.js, starts/stops playback, and logs player events. - Adds a native
TokenProvider+ environment-driven configuration to fetch camera tokens from Media Gateway using Basic auth. - Implements WebView2 hosting glue (virtual host mapping, navigation restrictions, bootstrap config injection, debug-only certificate bypass).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| Samples/Genetec Web Player/GwpDesktopPlayerSample/wwwroot/index.html | Local host page UI + player lifecycle + CSP + logging/event wiring |
| Samples/Genetec Web Player/GwpDesktopPlayerSample/TokenProvider.cs | Native configuration + COM-visible token provider calling Media Gateway /v2/token/{cameraId} |
| Samples/Genetec Web Player/GwpDesktopPlayerSample/MainWindow.xaml.cs | WebView2 initialization, virtual host mapping, navigation restrictions, host object + bootstrap injection |
| Samples/Genetec Web Player/GwpDesktopPlayerSample/MainWindow.xaml | WPF shell/header controls for credentials + WebView2 surface |
| Samples/Genetec Web Player/GwpDesktopPlayerSample/README.md | Usage, environment variables, CORS/cert guidance, limitations |
| Samples/Genetec Web Player/GwpDesktopPlayerSample/GwpDesktopPlayerSample.csproj | New WPF project targeting net8.0-windows with WebView2 package + wwwroot content copy |
| Samples/Genetec Web Player/GwpDesktopPlayerSample/App.xaml | WPF app startup wiring |
| Samples/Genetec Web Player/GwpDesktopPlayerSample/App.xaml.cs | WPF app code-behind stub |
| Samples/Genetec Web Player/GwpDesktopPlayerSample/AssemblyInfo.cs | ThemeInfo attribute for WPF resources |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
AreDevToolsEnabled defaults to true in WebView2. The previous code only set it to true under #if DEBUG but never set it to false otherwise, leaving DevTools accessible in Release builds.
XAML does not support #if preprocessor directives. The previous commit placed #if !DEBUG in MainWindow.xaml which broke the build. Moved the Visibility.Collapsed toggle into the constructor in MainWindow.xaml.cs where preprocessor directives work correctly.
- Dispose partially created player when start() rejects instead of leaving orphaned DOM/media state - Remove localhost-only restriction on development certificate bypass so developers can reach remote Media Gateways with self-signed certs
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.
No description provided.