mirror of https://github.com/ErsatzTV/ErsatzTV.git
10 changed files with 267 additions and 36 deletions
@ -1,11 +1,15 @@ |
|||||||
using System.Collections.Concurrent; |
namespace ErsatzTV.Core.Interfaces.FFmpeg; |
||||||
|
|
||||||
namespace ErsatzTV.Core.Interfaces.FFmpeg; |
|
||||||
|
|
||||||
public interface IFFmpegSegmenterService |
public interface IFFmpegSegmenterService |
||||||
{ |
{ |
||||||
ConcurrentDictionary<string, IHlsSessionWorker> SessionWorkers { get; } |
event EventHandler OnWorkersChanged; |
||||||
|
ICollection<IHlsSessionWorker> Workers { get; } |
||||||
|
bool TryGetWorker(string channelNumber, out IHlsSessionWorker worker); |
||||||
|
bool TryAddWorker(string channelNumber, IHlsSessionWorker worker); |
||||||
|
void AddOrUpdateWorker(string channelNumber, IHlsSessionWorker worker); |
||||||
|
void RemoveWorker(string channelNumber, out IHlsSessionWorker inactiveWorker); |
||||||
|
bool IsActive(string channelNumber); |
||||||
|
Task<bool> StopChannel(string channelNumber, CancellationToken cancellationToken); |
||||||
void TouchChannel(string channelNumber); |
void TouchChannel(string channelNumber); |
||||||
void PlayoutUpdated(string channelNumber); |
void PlayoutUpdated(string channelNumber); |
||||||
} |
} |
||||||
|
|||||||
@ -0,0 +1,62 @@ |
|||||||
|
@inject IJSRuntime JsRuntime |
||||||
|
|
||||||
|
<div> |
||||||
|
<MudDialog> |
||||||
|
<DialogContent> |
||||||
|
<media-controller style="width: 800px; height: calc(800px * 9/16)"> |
||||||
|
<video id="video" slot="media"></video> |
||||||
|
<media-control-bar> |
||||||
|
<media-mute-button></media-mute-button> |
||||||
|
<media-volume-range></media-volume-range> |
||||||
|
<media-fullscreen-button></media-fullscreen-button> |
||||||
|
</media-control-bar> |
||||||
|
</media-controller> |
||||||
|
</DialogContent> |
||||||
|
<DialogActions> |
||||||
|
<MudButton Color="Color.Primary" OnClick="Close">Close</MudButton> |
||||||
|
</DialogActions> |
||||||
|
</MudDialog> |
||||||
|
</div> |
||||||
|
|
||||||
|
@code { |
||||||
|
|
||||||
|
[CascadingParameter] |
||||||
|
MudDialogInstance MudDialog { get; set; } |
||||||
|
|
||||||
|
[Parameter] |
||||||
|
public string StreamUri { get; set; } |
||||||
|
|
||||||
|
protected override Task OnParametersSetAsync() |
||||||
|
{ |
||||||
|
return Task.CompletedTask; |
||||||
|
} |
||||||
|
|
||||||
|
protected override async Task OnAfterRenderAsync(bool firstRender) |
||||||
|
{ |
||||||
|
try |
||||||
|
{ |
||||||
|
await JsRuntime.InvokeVoidAsync("previewChannel", StreamUri); |
||||||
|
} |
||||||
|
catch (Exception) |
||||||
|
{ |
||||||
|
// ignored |
||||||
|
} |
||||||
|
|
||||||
|
await base.OnAfterRenderAsync(true); |
||||||
|
} |
||||||
|
|
||||||
|
private void Close() |
||||||
|
{ |
||||||
|
try |
||||||
|
{ |
||||||
|
JsRuntime.InvokeVoidAsync("stopPreview"); |
||||||
|
} |
||||||
|
catch (Exception) |
||||||
|
{ |
||||||
|
// ignored |
||||||
|
} |
||||||
|
|
||||||
|
MudDialog.Close(DialogResult.Ok(true)); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
Loading…
Reference in new issue