properly destroy channel preview (#1910)

This commit is contained in:
Jason Dove
2024-10-04 12:29:40 -05:00
committed by GitHub
parent 7bba422880
commit 7d6faee27b
3 changed files with 15 additions and 8 deletions
+2
View File
@@ -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
+5 -5
View File
@@ -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 @@
});
}
}
function stopPreview() {
var hls = $('#video').data('hls');
hls && hls.destroy();
@@ -114,7 +114,7 @@
}
}
};
window.clipboardCopy = {
copyText: async function (codeElement) {
if (navigator.clipboard && window.isSecureContext) {
@@ -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) {
+8 -3
View File
@@ -1,4 +1,5 @@
@inject IJSRuntime JsRuntime
@implements IDisposable
<div>
<MudDialog>
@@ -43,6 +44,11 @@
}
private void Close()
{
MudDialog.Close(DialogResult.Ok(true));
}
public void Dispose()
{
try
{
@@ -50,10 +56,9 @@
}
catch (Exception)
{
// ignored
// ignore
}
MudDialog.Close(DialogResult.Ok(true));
MudDialog?.Dispose();
}
}