Skip to content

feat(HikVision): add StartRecord/StopRecord function#7410

Merged
ArgoZhang merged 2 commits intomainfrom
feat-hik
Dec 25, 2025
Merged

feat(HikVision): add StartRecord/StopRecord function#7410
ArgoZhang merged 2 commits intomainfrom
feat-hik

Conversation

@ArgoZhang
Copy link
Member

@ArgoZhang ArgoZhang commented Dec 25, 2025

Link issues

fixes #7408

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ 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

Add recording controls to the HikVision sample to start and stop video recording during live preview and document the recording prerequisites and file location.

New Features:

  • Introduce StartRecord and StopRecord actions in the HikVision sample to control video recording from the UI.

Enhancements:

  • Update HikVision sample UI text and layout to better highlight usage notes and explain recording behavior.

Copilot AI review requested due to automatic review settings December 25, 2025 03:52
@bb-auto bb-auto bot added the enhancement New feature or request label Dec 25, 2025
@bb-auto bb-auto bot added this to the v10.1.0 milestone Dec 25, 2025
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 25, 2025

Reviewer's Guide

Adds start/stop recording capabilities to the HikVision demo component and wires them into the UI, including state management, button enablement, and user-facing guidance text.

Sequence diagram for HikVision start/stop recording interactions

sequenceDiagram
    actor User
    participant HikVisions
    participant HikVisionWebPlugin
    participant ToastService

    User->>HikVisions: Click_start_record_button
    HikVisions->>HikVisionWebPlugin: StartRecord()
    HikVisionWebPlugin-->>HikVisions: result(bool)
    alt Start_record_success
        HikVisions->>HikVisions: _startRecordStatus=true
        HikVisions->>HikVisions: _stopRecordStatus=false
        HikVisions->>ToastService: Success(消息通知, 开始录像成功)
    else Start_record_failure
        HikVisions->>ToastService: Error(消息通知, 开始录像失败)
    end

    User->>HikVisions: Click_stop_record_button
    HikVisions->>HikVisionWebPlugin: StopRecord()
    HikVisionWebPlugin-->>HikVisions: result(bool)
    alt Stop_record_success
        HikVisions->>HikVisions: _startRecordStatus=false
        HikVisions->>HikVisions: _stopRecordStatus=true
        HikVisions->>ToastService: Success(消息通知, 结束录像成功)
    else Stop_record_failure
        HikVisions->>ToastService: Error(消息通知, 结束录像失败)
    end
Loading

Updated class diagram for HikVisions recording state and handlers

classDiagram
    class HikVisions {
        bool _stopRealPlayStatus
        bool _openSoundStatus
        bool _closeSoundStatus
        bool _startRecordStatus
        bool _stopRecordStatus

        Task OnCapture()
        Task OnStartRecord()
        Task OnStopRecord()
        Task OnInitedAsync(bool initialized)
        Task OnStartRealPlayedAsync()
        Task OnStopRealPlayedAsync()
    }
Loading

File-Level Changes

Change Details Files
Introduce start/stop recording state and handlers in the HikVision sample component code-behind.
  • Add boolean flags to track start and stop recording button enabled states
  • Implement OnStartRecord and OnStopRecord async handlers that call the HikVision plugin API, update state flags, and show success/error toasts
  • Initialize and reset recording flags appropriately in existing real-play lifecycle callbacks
src/BootstrapBlazor.Server/Components/Samples/HikVisions.razor.cs
Expose recording controls and documentation in the HikVision sample UI.
  • Enhance the notice section with a labeled explanation of recording prerequisites and default file storage location
  • Add Start Record and Stop Record buttons bound to the new handlers and controlled by the recording state flags
src/BootstrapBlazor.Server/Components/Samples/HikVisions.razor

Assessment against linked issues

Issue Objective Addressed Explanation
#7408 Add StartRecord and StopRecord functionality to the HikVision sample, including invoking the underlying HikVision recording APIs and exposing corresponding UI controls.

Possibly linked issues


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

@ArgoZhang ArgoZhang merged commit bed84ac into main Dec 25, 2025
5 checks passed
@ArgoZhang ArgoZhang deleted the feat-hik branch December 25, 2025 03:52
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The toast messages in OnStartRecord/OnStopRecord use hardcoded Chinese strings; consider routing these through the existing Localizer to keep UI text consistent and translatable.
  • The recording path in the new "录像功能说明" section is hardcoded for a specific Windows user directory; if this can vary by installation or OS, consider making the path description more generic or derived from configuration.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The toast messages in OnStartRecord/OnStopRecord use hardcoded Chinese strings; consider routing these through the existing Localizer to keep UI text consistent and translatable.
- The recording path in the new "录像功能说明" section is hardcoded for a specific Windows user directory; if this can vary by installation or OS, consider making the path description more generic or derived from configuration.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov
Copy link

codecov bot commented Dec 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (32aebe2) to head (a20f0d6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7410   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          748       748           
  Lines        32793     32793           
  Branches      4551      4551           
=========================================
  Hits         32793     32793           
Flag Coverage Δ
BB 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
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

This PR adds recording functionality (StartRecord/StopRecord) to the HikVision web plugin component, allowing users to capture video recordings from HikVision network cameras.

  • Implements StartRecord and StopRecord methods with proper state management
  • Adds UI buttons for starting and stopping recordings with appropriate enable/disable logic
  • Updates documentation to explain recording functionality and file storage location

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/BootstrapBlazor.Server/Components/Samples/HikVisions.razor.cs Adds state variables and handler methods for record start/stop operations with toast notifications
src/BootstrapBlazor.Server/Components/Samples/HikVisions.razor Adds record control buttons and documentation explaining recording requirements and file storage
src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj Updates HikVision package reference from version 10.0.6 to 10.0.7

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

feat(HikVision): add StartRecord/StopRecord function

1 participant