Skip to content

refactor(HikVision): remove generic MediaMTX WebRTC player - #1406

Merged
ArgoZhang merged 2 commits into
masterfrom
refactor-hik
Dec 3, 2026
Merged

ArgoZhang merged 2 commits into
masterfrom
refactor-hik

Conversation

@ArgoZhang

@ArgoZhang ArgoZhang commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Link issues

fixes #1405

Summary By Copilot

  • 移除 HikVisionWebRtc、相关本地化资源和 BootstrapBlazor.MediaMtx 包引用。
  • 精简 BootstrapBlazor.HikVision 为海康威视 WebSDK 插件及海康专用模型。
  • 更新 HikVision 包文档和 Skill 索引,移除通用 WebRTC 播放说明。

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

此前存在的 HikVisionWebRtc 公共 API 被移除,引用该组件的应用需要迁移到通用 MediaMTX 播放组件。海康 WebSDK 插件及现有参数行为未改动。

Verification

  • Manual (required)
  • Automated

实际执行了 dotnet build src/components/BootstrapBlazor.MediaMtx/BootstrapBlazor.MediaMtx.csproj -f net11.0 --no-restore 和 dotnet build src/components/BootstrapBlazor.HikVision/BootstrapBlazor.HikVision.csproj -f net11.0 --no-restore;两个项目均通过,0 警告 0 错误。

Packaging changes reviewed?

  • Yes
  • No
  • N/A

已移除 HikVision 包对 MediaMTX 包的引用,并更新包文档和技能索引。

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Remove the generic MediaMTX WebRTC player from the HikVision package, retaining its HikVision WebSDK integration.

Enhancements:

  • Remove the HikVisionWebRtc component, leaving the HikVision package focused on the WebSDK plugin.

Documentation:

  • Remove generic MediaMTX WebRTC playback guidance from the HikVision package README and skill reference.

Chores:

  • Remove the HikVision package’s English and Chinese localization resources associated with the deleted component.
  • Update the HikVision project configuration and package metadata.

@sourcery-ai

sourcery-ai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

API

Remove the public HikVisionWebRtc component and its code-behind, eliminating the HikVision package’s generic MediaMTX WebRTC player API.

  • src/components/BootstrapBlazor.HikVision/Components/HikVisionWebRtc.razor (deleted)
  • src/components/BootstrapBlazor.HikVision/Components/HikVisionWebRtc.razor.cs (deleted)

UI

Remove the WebRTC player’s localized UI strings along with the player itself.

  • src/components/BootstrapBlazor.HikVision/Locales/en.json (deleted)
  • src/components/BootstrapBlazor.HikVision/Locales/zh.json (deleted)

Configuration

Update the HikVision project configuration to remove its MediaMTX package dependency.

  • src/components/BootstrapBlazor.HikVision/BootstrapBlazor.HikVision.csproj L4, L15 (removed lines), L30-34

Documentation

Remove generic WebRTC player setup and deployment guidance from the HikVision README and skill, retaining documentation for the WebSDK plugin.

  • src/components/BootstrapBlazor.HikVision/README.HikVision.md L3, L9 (removed lines)
  • src/components/BootstrapBlazor.HikVision/skills/bb-hikvision/SKILL.md L8

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@bb-auto bb-auto Bot added the enhancement New feature or request label Dec 3, 2026
@bb-auto bb-auto Bot added this to the v11.0.0 milestone Dec 3, 2026

@bb-auto bb-auto Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Auto approved by bb-auto

@ArgoZhang
ArgoZhang merged commit fdc838d into master Dec 3, 2026
3 checks passed
@ArgoZhang
ArgoZhang deleted the refactor-hik branch December 3, 2026 08:43
@sourcery-ai

sourcery-ai Bot commented Dec 3, 2026

Copy link
Copy Markdown

Linked issues

Checked at commit 49a7786

#1405 refactor(HikVision): remove generic WebRTC player from HikVision package · 2 of 3 met

# Requirement Status Notes
1 Remove HikVisionWebRtc from the HikVision package. ✅ Met The component files are deleted, and no remaining usages were found.
2 Remove the BootstrapBlazor.MediaMtx dependency. ✅ Met The HikVision project file no longer references BootstrapBlazor.MediaMtx.
3 Keep the package focused on HikVision-specific WebSDK components and documentation. 🟡 Partly met The README and skill content focus on the WebSDK plugin, but the skill description still advertises WebRTC preview API integration.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/components/BootstrapBlazor.HikVision/README.HikVision.md" line_range="3" />
<code_context>
 # BootstrapBlazor.HikVision

-海康威视摄像机预览组件,包括通过 MediaMTX 播放页面预览的 `HikVisionWebRtc`,以及依赖海康 WebSDK 的 `HikVisionWebPlugin`。
+海康威视摄像机预览组件,包括依赖海康 WebSDK 的 `HikVisionWebPlugin`。

</code_context>
<issue_to_address>
**HikVision examples fail to compile**

When users follow the MediaMTX example or upgrade an application using `HikVisionWebRtc` to 11.0.4, `HikVisionWebRtc` is no longer included, so the documented Razor element and existing calls fail compilation; shipping that removal in 11.0.4 also breaks callers without a major-version signal.

Keep `HikVisionWebRtc` available in this release, or defer its removal to a major release after updating the integration guidance.

Also at `src/components/BootstrapBlazor.HikVision/skills/bb-hikvision/SKILL.md:8`, `src/components/BootstrapBlazor.HikVision/README.HikVision.md:25`.
</issue_to_address>

### Comment 2
<location path="src/components/BootstrapBlazor.HikVision/skills/bb-hikvision/SKILL.md" line_range="8" />
<code_context>
-- 自管网关公网部署需设置 `WebRtcPublicUrl`、`WebRtcConfigPath`,自行部署 YAML 片段并配置复制。HTTPS/nginx 负责播放页和信令,媒体另需可达的 UDP ICE 地址与端口;仅替换播放 URL 不够。
-- 同一用户的宿主可复用网关;指纹变化且目标进程路径相同时会自动重启,打断所有共享观看者。宿主退出后网关继续运行,动态路径在网关重启后需重新登记。
-- 网关不自动转码,视频、音频编码须兼容浏览器。音频可使用 G.711 μ-law(PCMU)或 A-law(PCMA);默认静音,需要时取消静音。
+先读 [references/llms.txt](references/llms.txt),再查 [HikVisionWebPlugin](references/components/HikVisionWebPlugin.txt)。以实际引用版本和源码为准,不编造参数。

 ## WebSDK 插件
</code_context>
<issue_to_address>
**Stale skill description**

The issue asks to keep the package documentation focused on HikVision-specific WebSDK components. The skill description still says it covers WebRTC preview APIs, although the updated reference directs users only to HikVisionWebPlugin.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@@ -1,56 +1,11 @@
# BootstrapBlazor.HikVision

海康威视摄像机预览组件,包括通过 MediaMTX 播放页面预览的 `HikVisionWebRtc`,以及依赖海康 WebSDK 的 `HikVisionWebPlugin`。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 High · HikVision examples fail to compile

When users follow the MediaMTX example or upgrade an application using HikVisionWebRtc to 11.0.4, HikVisionWebRtc is no longer included, so the documented Razor element and existing calls fail compilation; shipping that removal in 11.0.4 also breaks callers without a major-version signal.

Keep HikVisionWebRtc available in this release, or defer its removal to a major release after updating the integration guidance.

Also at src/components/BootstrapBlazor.HikVision/skills/bb-hikvision/SKILL.md:8, src/components/BootstrapBlazor.HikVision/README.HikVision.md:25.

Prompt for AI agents
In `src/components/BootstrapBlazor.HikVision/README.HikVision.md` at line 3:

**HikVision examples fail to compile**

When users follow the MediaMTX example or upgrade an application using `HikVisionWebRtc` to 11.0.4, `HikVisionWebRtc` is no longer included, so the documented Razor element and existing calls fail compilation; shipping that removal in 11.0.4 also breaks callers without a major-version signal.

Keep `HikVisionWebRtc` available in this release, or defer its removal to a major release after updating the integration guidance.

Also at `src/components/BootstrapBlazor.HikVision/skills/bb-hikvision/SKILL.md:8`, `src/components/BootstrapBlazor.HikVision/README.HikVision.md:25`.

From AGENTS.md L23:

复用现有能力,保留用户的已有改动和公开 API 行为

From docs/agents/component-checklist.md L5:

保留已有调用方式和所支持框架的行为

- 自管网关公网部署需设置 `WebRtcPublicUrl`、`WebRtcConfigPath`,自行部署 YAML 片段并配置复制。HTTPS/nginx 负责播放页和信令,媒体另需可达的 UDP ICE 地址与端口;仅替换播放 URL 不够。
- 同一用户的宿主可复用网关;指纹变化且目标进程路径相同时会自动重启,打断所有共享观看者。宿主退出后网关继续运行,动态路径在网关重启后需重新登记。
- 网关不自动转码,视频、音频编码须兼容浏览器。音频可使用 G.711 μ-law(PCMU)或 A-law(PCMA);默认静音,需要时取消静音。
先读 [references/llms.txt](references/llms.txt),再查 [HikVisionWebPlugin](references/components/HikVisionWebPlugin.txt)。以实际引用版本和源码为准,不编造参数。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚪ Low · Stale skill description

The issue asks to keep the package documentation focused on HikVision-specific WebSDK components. The skill description still says it covers WebRTC preview APIs, although the updated reference directs users only to HikVisionWebPlugin.

Prompt for AI agents
In `src/components/BootstrapBlazor.HikVision/skills/bb-hikvision/SKILL.md` at line 8:

**Stale skill description**

The issue asks to keep the package documentation focused on HikVision-specific WebSDK components. The skill description still says it covers WebRTC preview APIs, although the updated reference directs users only to HikVisionWebPlugin.

From #1405:

Keep the package focused on HikVision-specific WebSDK components and documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(HikVision): remove generic WebRTC player from HikVision package

1 participant