Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>11.0.1</Version>
<Version>11.0.2</Version>
<SkillName>bb-mediamtx</SkillName>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ static class HttpClientExtensions
{
extension(HttpClient client)
{
internal HttpRequestMessage CreateAuthorizationRequest(HttpMethod method, string relativeUri, string password)
internal HttpRequestMessage CreateAuthorizationRequest(HttpMethod method, string relativeUri, string password, string userName = "gateway")
{
var baseAddress = client.BaseAddress!;
var request = new HttpRequestMessage(method, new Uri(baseAddress, relativeUri));
var authValue = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes($"gateway:{password}")));
var authValue = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes($"{userName}:{password}")));
request.Headers.Authorization = authValue;
return request;
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/BootstrapBlazor.MediaMtx/IMediaMtxService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ namespace BootstrapBlazor.Components;
public interface IMediaMtxService
{
/// <summary>
/// <para lang="zh">确保网关已启动并就绪,失败时抛出异常。默认实现复用本宿主的运行中进程;工具缺失时需手动部署。</para>
/// <para lang="en">Ensures the gateway is running and ready, throwing an exception on failure. The default service reuses its running process; missing tools must be deployed manually.</para>
/// <para lang="zh">确保网关已启动并就绪,失败时抛出异常。默认实现复用同一用户启动的兼容网关;外部网关模式连接已部署的本机网关。</para>
/// <para lang="en">Ensures the gateway is running and ready, throwing an exception on failure. The default service reuses a compatible gateway started by the same user; external gateway mode connects to an independently deployed local gateway.</para>
/// <para><version>11.0.0</version></para>
/// </summary>
/// <param name="cancellationToken"><para lang="zh">取消令牌。</para><para lang="en">The cancellation token.</para></param>
Expand Down
25 changes: 23 additions & 2 deletions src/components/BootstrapBlazor.MediaMtx/MediaMtxOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,29 @@ public sealed class MediaMtxOptions
public int ApiPort { get; set; } = 9997;

/// <summary>
/// <para lang="zh">获得/设置网关启动时配置的摄像头,键为播放路径,值中的 Path 和 PlayUrl 被忽略。密码应通过安全配置源提供;环境变量可能被子进程继承。</para>
/// <para lang="en">Gets or sets the cameras configured when the gateway starts. Keys are playback paths; Path and PlayUrl in each value are ignored. Supply passwords through a secure configuration source; environment variables may be inherited by child processes.</para>
/// <para lang="zh">获得/设置是否连接由外部管理的本机 MediaMTX 网关。默认值为 false。</para>
/// <para lang="en">Gets or sets whether to connect to an externally managed local MediaMTX gateway. Defaults to false.</para>
/// <para><version>11.0.2</version></para>
/// </summary>
public bool UseExternalGateway { get; set; }

/// <summary>
/// <para lang="zh">获得/设置外部网关 Control API 的用户名,默认为 gateway。仅在外部网关模式下使用。</para>
/// <para lang="en">Gets or sets the external gateway Control API user name. Defaults to gateway and is used only in external gateway mode.</para>
/// <para><version>11.0.2</version></para>
/// </summary>
public string ExternalApiUserName { get; set; } = "gateway";

/// <summary>
/// <para lang="zh">获得/设置外部网关 Control API 的密码。仅在外部网关模式下使用,应通过安全配置源提供。</para>
/// <para lang="en">Gets or sets the external gateway Control API password. Used only in external gateway mode; supply it through a secure configuration source.</para>
/// <para><version>11.0.2</version></para>
/// </summary>
public string? ExternalApiPassword { get; set; }

/// <summary>
/// <para lang="zh">获得/设置网关启动或连接外部网关时登记的摄像头,键为播放路径,值中的 Path 和 PlayUrl 被忽略。密码应通过安全配置源提供;环境变量可能被子进程继承。</para>
/// <para lang="en">Gets or sets the cameras configured when starting or connecting to the gateway. Keys are playback paths; Path and PlayUrl in each value are ignored. Supply passwords through a secure configuration source; environment variables may be inherited by child processes.</para>
/// <para><version>11.0.0</version></para>
/// </summary>
public Dictionary<string, MediaMtxCameraOptions> Cameras { get; set; } = new();
Expand Down
Loading
Loading