-
-
Notifications
You must be signed in to change notification settings - Fork 5
feat(HikVision): add OnGetChannelsAsync parameter #789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuideExtends the HikVision Blazor component to expose channel list information on login, refactors login-related naming and enums for clarity, and wires up JavaScript-side channel discovery and callbacks into new C# models. Sequence diagram for HikVision login and channel list callbacksequenceDiagram
actor User
participant HikVisionWebPlugin as HikVisionWebPlugin_CSharp
participant JSRuntime
participant HikVisionWebPluginJs as HikVisionWebPlugin_js
participant HikvisionJs as hikvision_js
participant WebVideoCtrl
User->>HikVisionWebPlugin: Login(ip, port, userName, password, loginType)
HikVisionWebPlugin->>JSRuntime: InvokeAsync login(Id, ip, port, userName, password, loginType)
JSRuntime->>HikVisionWebPluginJs: login(id, ip, port, userName, password, loginType)
HikVisionWebPluginJs->>HikvisionJs: login(id, ip, port, userName, password, loginType)
HikvisionJs->>WebVideoCtrl: I_Login(ip, loginType, port, userName, password)
WebVideoCtrl-->>HikvisionJs: success
HikvisionJs->>HikvisionJs: getChannelList(vision)
HikvisionJs->>WebVideoCtrl: I_GetAnalogChannelInfo(szDeviceIdentify)
WebVideoCtrl-->>HikvisionJs: analog channel XML
HikvisionJs->>HikvisionJs: parse to analogChannels
HikvisionJs->>WebVideoCtrl: I_GetDigitalChannelInfo(szDeviceIdentify)
WebVideoCtrl-->>HikvisionJs: digital channel XML
HikvisionJs->>HikvisionJs: parse to digitalChannels
HikvisionJs->>WebVideoCtrl: I_GetZeroChannelInfo(szDeviceIdentify)
WebVideoCtrl-->>HikvisionJs: zero channel XML
HikvisionJs->>HikvisionJs: parse to zeroChannels
HikvisionJs->>HikvisionJs: vision.logined = true
HikvisionJs-->>HikVisionWebPluginJs: logined flag
HikVisionWebPluginJs->>HikVisionWebPluginJs: read analogChannels, digitalChannels, zeroChannels
HikVisionWebPluginJs->>HikVisionWebPlugin: invokeMethodAsync TriggerGetChannelList(HikVisionChannel)
HikVisionWebPlugin->>HikVisionWebPlugin: TriggerGetChannelList(channel)
HikVisionWebPlugin->>HikVisionWebPlugin: OnGetChannelsAsync(channel)
HikVisionWebPlugin-->>User: Login result with channels available
Updated class diagram for HikVision channel models and componentclassDiagram
class HikVisionLoginType {
<<enumeration>>
Http
Https
}
class HikVisionAnalogChannelInfo {
+int Id
+int InputPort
+string Name
+string VideoFormat
}
class HikVisionDigitalChannelInfo {
+int Id
+int InputPort
+string Name
+string VideoFormat
}
class HikVisionZeroChannelInfo {
+int Id
+int InputPort
+bool Enabled
}
class HikVisionChannel {
+List~HikVisionAnalogChannelInfo~ AnalogChannels
+List~HikVisionDigitalChannelInfo~ DigitalChannels
+List~HikVisionZeroChannelInfo~ ZeroChannels
}
class IHikVision {
<<interface>>
+Task~bool~ Login(string ip, int port, string userName, string password, HikVisionLoginType loginType)
+Task Logout()
}
class DefaultHicVision {
-IJSRuntime jsRuntime
-bool _initialized
-bool _logined
+Task~bool~ Login(string ip, int port, string userName, string password, HikVisionLoginType loginType)
+Task Logout()
}
class HikVisionWebPlugin {
+string Id
+string Ip
+int Port
+string UserName
+string Password
+HikVisionLoginType LoginType
+string Width
+string Height
+Func~bool,Task~ OnInitedAsync
+Func~Task~ OnLoginAsync
+Func~HikVisionChannel,Task~ OnGetChannelsAsync
+Func~Task~ OnLogoutAsync
+Func~Task~ OnStartRealPlayingAsync
+Func~Task~ OnStopRealPlayingAsync
+bool Inited
+bool IsLogin
+bool IsRealPlaying
+Task~bool~ Login(string ip, int port, string userName, string password, HikVisionLoginType loginType)
+Task Logout()
+Task GetChannelList()
+Task StartRealPlay(int streamType, int channelId)
+Task StopRealPlay()
+Task TriggerInited(bool inited)
+Task TriggerGetChannelList(HikVisionChannel channel)
}
IHikVision <|.. DefaultHicVision
HikVisionChannel o-- HikVisionAnalogChannelInfo
HikVisionChannel o-- HikVisionDigitalChannelInfo
HikVisionChannel o-- HikVisionZeroChannelInfo
HikVisionWebPlugin ..> HikVisionLoginType
HikVisionWebPlugin ..> HikVisionChannel
HikVisionWebPlugin ..> HikVisionAnalogChannelInfo
HikVisionWebPlugin ..> HikVisionDigitalChannelInfo
HikVisionWebPlugin ..> HikVisionZeroChannelInfo
DefaultHicVision ..> HikVisionLoginType
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes and found some issues that need to be addressed.
- The new
GetChannelListC# method calls a JS function namedgetChannelList, buthikvision.jsno longer exports this symbol (it’s only defined as an internalconst), so this interop call will fail at runtime; either exportgetChannelListor route the call through the existing plugin JS wrapper. - The
HikVisionDigitalChannelInfomodel doesn’t match the JS payload: JS builds objects{ id, online }while the C# type expectsInputPort,Name, andVideoFormat, which will serialize/deserialize incorrectly; align the JS shape or the C# model (including property names) and update the XML docs accordingly. - Several comments and names appear inconsistent with behavior:
OnGetChannelsAsyncis documented as a stop-preview callback and the XML summaries forHikVisionDigitalChannelInfo/HikVisionZeroChannelInfostill say “模拟通道信息”; it would be clearer to update these descriptions and ensure the login callback naming (OnLoginAsyncvsTriggerGetChannelListtiming) accurately reflects when channels are available.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new `GetChannelList` C# method calls a JS function named `getChannelList`, but `hikvision.js` no longer exports this symbol (it’s only defined as an internal `const`), so this interop call will fail at runtime; either export `getChannelList` or route the call through the existing plugin JS wrapper.
- The `HikVisionDigitalChannelInfo` model doesn’t match the JS payload: JS builds objects `{ id, online }` while the C# type expects `InputPort`, `Name`, and `VideoFormat`, which will serialize/deserialize incorrectly; align the JS shape or the C# model (including property names) and update the XML docs accordingly.
- Several comments and names appear inconsistent with behavior: `OnGetChannelsAsync` is documented as a stop-preview callback and the XML summaries for `HikVisionDigitalChannelInfo`/`HikVisionZeroChannelInfo` still say “模拟通道信息”; it would be clearer to update these descriptions and ensure the login callback naming (`OnLoginAsync` vs `TriggerGetChannelList` timing) accurately reflects when channels are available.
## Individual Comments
### Comment 1
<location> `src/components/BootstrapBlazor.HikVision/Components/HikVisionWebPlugin.razor.cs:184-187` </location>
<code_context>
+ /// 获得通道列表方法
+ /// </summary>
+ /// <returns></returns>
+ public async Task GetChannelList()
+ {
+ ThrowIfNotInited();
+ await InvokeVoidAsync("getChannelList", Id);
+ }
+
</code_context>
<issue_to_address>
**issue (bug_risk):** The C# `GetChannelList` method invokes a JS function that is not exported, which will cause a JS interop error at runtime.
This calls `InvokeVoidAsync("getChannelList", Id)`, but `HikVisionWebPlugin.razor.js` doesn’t export `getChannelList`, and in `hikvision.js` it is only defined as an internal `const` (not exported). This will cause the interop call to fail at runtime. Please either export `getChannelList` on the JS side and re-export it via the `.razor.js` module, or remove/repurpose this C# method and rely on the existing login callback that fetches channel information.
</issue_to_address>
### Comment 2
<location> `src/components/BootstrapBlazor.HikVision/wwwroot/hikvision.js:78` </location>
<code_context>
}
-export { login, logout, startRealPlay, stopRealPlay }
+export async function login(id, ip, port, userName, password, loginType) {
+ const vision = Data.get(id);
+ await loginVision(id, ip, port, userName, password, loginType);
</code_context>
<issue_to_address>
**issue (bug_risk):** The `login` function doesn’t resolve based on the async callbacks, causing race conditions for callers awaiting it.
Because `login` is marked `async` but doesn’t return a Promise tied to `WebVideoCtrl.I_Login`’s callbacks, `await login(...)` completes before the login actually finishes and before `vision.logined`/channels are updated. Wrap the login flow in a Promise, resolve/reject it in the `success`/`error` callbacks, and return that Promise so callers can reliably await the completed login state.
</issue_to_address>
### Comment 3
<location> `src/components/BootstrapBlazor.HikVision/Components/HikVisionDigitalChannelInfo.cs:10-19` </location>
<code_context>
+/// <summary>
+/// 模拟通道信息
+/// </summary>
+public class HikVisionDigitalChannelInfo()
+{
+ /// <summary>
+ /// 获得 通道 Id
+ /// </summary>
+ public int Id { get; set; }
+
+ /// <summary>
+ /// 获得 通道号
+ /// </summary>
+ public int InputPort { get; set; }
+
+ /// <summary>
+ /// 获得 通道名称
+ /// </summary>
+ public string? Name { get; set; }
+
+ /// <summary>
+ /// 获得 通道制式
+ /// </summary>
+ public string? VideoFormat { get; set; }
+}
</code_context>
<issue_to_address>
**suggestion (bug_risk):** The `HikVisionDigitalChannelInfo` model doesn’t align with the JS channel data shape.
On the JS side `digitalChannels` are shaped as `{ id, online }`, but this class exposes `Id`, `InputPort`, `Name`, and `VideoFormat`. When JS data is marshalled, only `Id` will bind and `online` will be dropped. Please either add an `Online` property (and remove any unused ones) or update the JS mapping to populate the properties defined here so the interop model matches the actual payload.
</issue_to_address>
### Comment 4
<location> `src/components/BootstrapBlazor.HikVision/Components/HikVisionDigitalChannelInfo.cs:7-8` </location>
<code_context>
+
+namespace BootstrapBlazor.Components;
+
+/// <summary>
+/// 模拟通道信息
+/// </summary>
+public class HikVisionAnalogChannelInfo()
</code_context>
<issue_to_address>
**nitpick (typo):** The XML summary for `HikVisionDigitalChannelInfo` refers to it as an analog channel.
The summary text currently says `模拟通道信息` (analog channel info), which conflicts with this type representing digital channel information and with `HikVisionAnalogChannelInfo`. Please update the summary to describe it as a digital channel type to avoid confusion in the API docs.
</issue_to_address>
### Comment 5
<location> `src/components/BootstrapBlazor.HikVision/Components/HikVisionZeroChannelInfo.cs:7-8` </location>
<code_context>
+
+namespace BootstrapBlazor.Components;
+
+/// <summary>
+/// 模拟通道信息
+/// </summary>
+public class HikVisionAnalogChannelInfo()
</code_context>
<issue_to_address>
**nitpick (typo):** The XML summary for `HikVisionZeroChannelInfo` is misleading.
Please update the summary text to explicitly describe this as zero-channel information so it’s clearly distinguished from the analog and digital channel types.
</issue_to_address>
### Comment 6
<location> `src/components/BootstrapBlazor.HikVision/Components/HikVisionWebPlugin.razor.js:2` </location>
<code_context>
-import { init as initVision, login, logout, startRealPlay, stopRealPlay, dispose as disposeVision } from '../hikvision.js';
+import { init as initVision, login as loginVision, logout, startRealPlay, stopRealPlay, dispose as disposeVision } from '../hikvision.js';
+import Data from '../../BootstrapBlazor/modules/data.js';
import EventHandler from '../../BootstrapBlazor/modules/event-handler.js';
</code_context>
<issue_to_address>
**issue (complexity):** Consider avoiding use of the shared `Data` store in this interop wrapper and instead pass an `invoke` callback through to `hikvision.js` so channel handling and state live in one place.
You can keep the new feature while reducing the indirection and shared state by removing `Data` usage from this file and pushing the “channels ready” callback into `hikvision.js`.
### 1. Keep `invoke` local to this module instead of using `Data`
```js
// hikvisionInterop.js (this file)
import {
init as initVision,
login as loginVision,
logout,
startRealPlay,
stopRealPlay,
dispose as disposeVision
} from '../hikvision.js';
const invokers = new Map(); // id -> invoke
export async function init(id, invoke) {
const el = document.getElementById(id);
if (el === null) {
return;
}
invokers.set(id, invoke);
const inited = await initVision(id);
await invoke.invokeMethodAsync('TriggerInited', inited);
}
export async function login(id, ip, port, userName, password, loginType) {
const invoke = invokers.get(id);
const logined = await loginVision(id, ip, port, userName, password, loginType, invoke);
return logined;
}
export { logout, startRealPlay, stopRealPlay };
export function dispose(id) {
invokers.delete(id);
disposeVision(id);
}
```
### 2. Move the channel callback into `hikvision.js`
In `hikvision.js`, keep using `Data` for camera/session state only, and invoke .NET when channels are ready:
```js
// hikvision.js
import Data from '../../BootstrapBlazor/modules/data.js';
export async function login(id, ip, port, userName, password, loginType, invoke) {
const vision = Data.get(id) ?? {};
// ... existing login logic that sets vision.logined, vision.analogChannels, etc.
// Data.set(id, vision) as you already do
if (vision.logined && invoke) {
await invoke.invokeMethodAsync('TriggerGetChannelList', {
analogChannels: vision.analogChannels,
digitalChannels: vision.digitalChannels,
zeroChannels: vision.zeroChannels
});
}
return vision.logined;
}
```
This keeps:
- All camera state in `hikvision.js` (via `Data`)
- All interop plumbing (`invoke`) local to the wrapper module
- `login` sequencing readable in one place (no need to “peek” into `Data` from two modules)
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| public async Task GetChannelList() | ||
| { | ||
| ThrowIfNotInited(); | ||
| await InvokeVoidAsync("getChannelList", Id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): The C# GetChannelList method invokes a JS function that is not exported, which will cause a JS interop error at runtime.
This calls InvokeVoidAsync("getChannelList", Id), but HikVisionWebPlugin.razor.js doesn’t export getChannelList, and in hikvision.js it is only defined as an internal const (not exported). This will cause the interop call to fail at runtime. Please either export getChannelList on the JS side and re-export it via the .razor.js module, or remove/repurpose this C# method and rely on the existing login callback that fetches channel information.
| public class HikVisionDigitalChannelInfo() | ||
| { | ||
| /// <summary> | ||
| /// 获得 通道 Id | ||
| /// </summary> | ||
| public int Id { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// 获得 通道号 | ||
| /// </summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (bug_risk): The HikVisionDigitalChannelInfo model doesn’t align with the JS channel data shape.
On the JS side digitalChannels are shaped as { id, online }, but this class exposes Id, InputPort, Name, and VideoFormat. When JS data is marshalled, only Id will bind and online will be dropped. Please either add an Online property (and remove any unused ones) or update the JS mapping to populate the properties defined here so the interop model matches the actual payload.
| /// <summary> | ||
| /// 模拟通道信息 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick (typo): The XML summary for HikVisionDigitalChannelInfo refers to it as an analog channel.
The summary text currently says 模拟通道信息 (analog channel info), which conflicts with this type representing digital channel information and with HikVisionAnalogChannelInfo. Please update the summary to describe it as a digital channel type to avoid confusion in the API docs.
| /// <summary> | ||
| /// 模拟通道信息 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick (typo): The XML summary for HikVisionZeroChannelInfo is misleading.
Please update the summary text to explicitly describe this as zero-channel information so it’s clearly distinguished from the analog and digital channel types.
There was a problem hiding this 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 pull request adds a new OnGetChannelsAsync callback parameter to the HikVision component, enabling consumers to receive channel information after successful login. The PR also performs several refactoring improvements including renaming the LoginType enum to HikVisionLoginType for better namespacing, renaming callback parameters from past tense to present tense (e.g., OnLoginedAsync to OnLoginAsync), and restructuring the channel retrieval logic to be called during login rather than during real-time playback.
Key changes:
- Added
OnGetChannelsAsynccallback with new channel model classes to expose channel information - Refactored channel list retrieval to occur during login instead of during video playback
- Renamed enum and parameters for better naming consistency and clarity
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| hikvision.js | Refactored to retrieve channel lists during login; fixed data structure initialization; added parsing improvements for channel properties |
| HikVisionWebPlugin.razor.js | Added wrapper logic to invoke C# callback with channel data after successful login |
| IHikVision.cs | Updated interface to use renamed HikVisionLoginType enum |
| DefaultHicVision.cs | Updated implementation to use renamed HikVisionLoginType enum |
| HikVisionWebPlugin.razor.cs | Added OnGetChannelsAsync parameter; renamed callbacks to present tense; added TriggerGetChannelList method; renamed IsLogined to IsLogin |
| HikVisionLoginType.cs | Renamed enum from LoginType to HikVisionLoginType for better namespacing |
| HikVisionZeroChannelInfo.cs | New model class for zero channel information with Id, InputPort, and Enabled properties |
| HikVisionDigitalChannelInfo.cs | New model class for digital channel information (has property mismatch issue with JavaScript) |
| HikVisionChannel.cs | New container class to hold all channel types (analog, digital, zero) |
| HikVisionAnalogChannelInfo.cs | New model class for analog channel information |
| BootstrapBlazor.HikVision.csproj | Version bumped from beta02 to beta03 |
Comments suppressed due to low confidence (1)
src/components/BootstrapBlazor.HikVision/wwwroot/hikvision.js:109
- Unused variable logined.
const { szDeviceIdentify, logined } = vision;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (oError.errorCode === ERROR_CODE_LOGIN_REPEATLOGIN) { | ||
| vision.logined = true; | ||
| return; | ||
| return true; |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When handling repeat login (ERROR_CODE_LOGIN_REPEATLOGIN), the code sets vision.logined = true and returns true, but getChannelList is not called in this case. This means the channel information won't be populated when a repeat login occurs, leading to inconsistent behavior compared to the success path where getChannelList is called. Consider calling getChannelList(vision) before setting vision.logined = true in the repeat login case.
| const getChannelInfo = vision => { | ||
| const { szDeviceIdentify } = vision; | ||
| const getChannelList = vision => { | ||
| const { szDeviceIdentify, logined } = vision; |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logined variable is destructured from vision but never used in the getChannelList function. Consider removing it to clean up the code.
| const { szDeviceIdentify, logined } = vision; | |
| const { szDeviceIdentify } = vision; |
| public List<HikVisionDigitalChannelInfo> DigitalChannels { get; set; } = []; | ||
|
|
||
| /// <summary> | ||
| /// 获得/设置 数字通道信息集合 |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment on line 23 says "数字通道信息集合" (digital channel info collection) which is identical to the comment on line 18 for DigitalChannels. The comment for ZeroChannels should be "零通道信息集合" (zero channel info collection) instead.
| /// 获得/设置 数字通道信息集合 | |
| /// 获得/设置 零通道信息集合 |
|
|
||
| /// <summary> | ||
| /// 获得 Websdk 插件是否初始化成功 | ||
| /// 获得 Web sdk 插件是否初始化成功 |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment uses "Web sdk" (with a space and lowercase "sdk") while line 10 uses "WebSdk" (no space, camelCase). For consistency, this should also be "WebSdk" to match the naming convention used elsewhere in the file.
| /// 获得 Web sdk 插件是否初始化成功 | |
| /// 获得 WebSdk 插件是否初始化成功 |
| /// 获得 是否已登录 | ||
| /// </summary> | ||
| public bool IsLogined { get; private set; } | ||
| public bool IsLogin { get; private set; } |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The property name IsLogin is grammatically awkward. Consider using IsLoggedIn instead, which is the standard past participle form used in similar contexts (e.g., User.IsLoggedIn() is a common pattern). Alternatively, IsAuthenticated would also be appropriate.
| public bool IsLogin { get; private set; } | |
| public bool IsLoggedIn { get; private set; } |
| public Func<Task>? OnLoginAsync { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// 获得/设置 停止预览后回调方法 |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation comment incorrectly states "停止预览后回调方法" (callback method after stopping preview), but this parameter is OnGetChannelsAsync which is called after getting the channel list. The comment should be something like "获取通道列表后回调方法" (callback method after getting channel list) instead.
| /// 获得/设置 停止预览后回调方法 | |
| /// 获得/设置 获取通道列表后回调方法 |
| namespace BootstrapBlazor.Components; | ||
|
|
||
| /// <summary> | ||
| /// 模拟通道信息 |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation comment incorrectly states "模拟通道信息" (analog channel info), but this class represents digital channel information. It should be "数字通道信息" (digital channel info) instead.
| /// 模拟通道信息 | |
| /// 数字通道信息 |
| namespace BootstrapBlazor.Components; | ||
|
|
||
| /// <summary> | ||
| /// 模拟通道信息 |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation comment incorrectly states "模拟通道信息" (analog channel info), but this class represents zero channel information. It should be "零通道信息" (zero channel info) instead.
| /// 模拟通道信息 | |
| /// 零通道信息 |
| /// 获得 通道号 | ||
| /// </summary> | ||
| public int InputPort { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// 获得 通道名称 | ||
| /// </summary> | ||
| public string? Name { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// 获得 通道制式 | ||
| /// </summary> | ||
| public string? VideoFormat { get; set; } |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JavaScript code in hikvision.js (lines 134-138) sets an online property for digital channels, not InputPort, Name, or VideoFormat. This mismatch will cause deserialization issues when JavaScript passes data to C#. The HikVisionDigitalChannelInfo class should have an Online property (string or bool) instead of InputPort, Name, and VideoFormat, or the JavaScript code needs to be updated to extract these fields from the XML.
| /// 获得 通道号 | |
| /// </summary> | |
| public int InputPort { get; set; } | |
| /// <summary> | |
| /// 获得 通道名称 | |
| /// </summary> | |
| public string? Name { get; set; } | |
| /// <summary> | |
| /// 获得 通道制式 | |
| /// </summary> | |
| public string? VideoFormat { get; set; } | |
| /// 获得 通道在线状态 | |
| /// </summary> | |
| public string? Online { get; set; } |
| import EventHandler from '../../BootstrapBlazor/modules/event-handler.js'; | ||
|
|
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import EventHandler.
| import EventHandler from '../../BootstrapBlazor/modules/event-handler.js'; |
Link issues
fixes #788
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Add channel list retrieval and callback support to the HikVision web plugin while standardizing login types and callback naming.
New Features:
Enhancements: