Skip to content

GWP desktop player sample#171

Open
alafleur-genetec wants to merge 9 commits intomainfrom
feat/gwp-desktop-player-sample
Open

GWP desktop player sample#171
alafleur-genetec wants to merge 9 commits intomainfrom
feat/gwp-desktop-player-sample

Conversation

@alafleur-genetec
Copy link
Copy Markdown
Member

No description provided.

@alafleur-genetec alafleur-genetec changed the title feat: add GWP desktop player sample GWP desktop player sample Apr 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 loads gwp.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.

Comment thread Samples/Genetec Web Player/GwpDesktopPlayerSample/TokenProvider.cs Outdated
Comment thread Samples/Genetec Web Player/GwpDesktopPlayerSample/MainWindow.xaml
Comment thread Samples/Genetec Web Player/GwpDesktopPlayerSample/App.xaml Outdated
Comment thread Samples/Genetec Web Player/GwpDesktopPlayerSample/TokenProvider.cs
alafleur-genetec and others added 6 commits April 1, 2026 20:58
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.
@alafleur-genetec alafleur-genetec self-assigned this Apr 1, 2026
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants