Browse Source

properly destroy channel preview (#1910)

pull/1915/head
Jason Dove 10 months ago committed by GitHub
parent
commit
7d6faee27b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 10
      ErsatzTV/Pages/_Host.cshtml
  3. 11
      ErsatzTV/Shared/ChannelPreviewDialog.razor

2
CHANGELOG.md

@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix startup error with MySql backend caused by database cleaner
- Fix emptying trash with ElasticSearch backend
- Fix double loading of trash UI elements, and fix reloading of all UI elements after emptying trash
- Fix destroying channel preview player when preview dialog is closed
- This bug made it difficult to "stop" a channel after previewing it
## [0.8.8-beta] - 2024-09-19
### Added

10
ErsatzTV/Pages/_Host.cshtml

@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
$("h2").addClass("mud-typography mud-typography-h4");
$("h3").addClass("mud-typography mud-typography-h5");
}
function previewChannel(uri) {
var video = document.getElementById('video');
if (Hls.isSupported()) {
@ -80,7 +80,7 @@ @@ -80,7 +80,7 @@
});
}
}
function stopPreview() {
var hls = $('#video').data('hls');
hls && hls.destroy();
@ -114,7 +114,7 @@ @@ -114,7 +114,7 @@
}
}
};
window.clipboardCopy = {
copyText: async function (codeElement) {
if (navigator.clipboard && window.isSecureContext) {
@ -124,10 +124,10 @@ @@ -124,10 +124,10 @@
textArea.value = codeElement.textContent;
textArea.style.position = "absolute";
textArea.style.left = "-999999px";
document.body.prepend(textArea);
textArea.select();
try {
document.execCommand('copy');
} catch (error) {

11
ErsatzTV/Shared/ChannelPreviewDialog.razor

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
@inject IJSRuntime JsRuntime
@implements IDisposable
<div>
<MudDialog>
@ -43,6 +44,11 @@ @@ -43,6 +44,11 @@
}
private void Close()
{
MudDialog.Close(DialogResult.Ok(true));
}
public void Dispose()
{
try
{
@ -50,10 +56,9 @@ @@ -50,10 +56,9 @@
}
catch (Exception)
{
// ignored
// ignore
}
MudDialog.Close(DialogResult.Ok(true));
MudDialog?.Dispose();
}
}
Loading…
Cancel
Save