Fix stream
This commit is contained in:
1 parent
e84161901f
commit
47d67156b7
3 files changed
+78
-32
No files matched your search
@@ -412,6 +412,9 @@
|
||||
<button class="btn btn-danger" id="btn-stop" onclick="stopRecount()" disabled>
|
||||
■ STOP
|
||||
</button>
|
||||
<button class="btn btn-ghost" id="btn-download" onclick="downloadFile()" disabled>
|
||||
<i class="fas fa-download"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -466,6 +469,7 @@ function selectFile(path, name) {
|
||||
selectedFile = null;
|
||||
batchResultLoaded = false;
|
||||
document.getElementById('btn-start').disabled = true;
|
||||
document.getElementById('btn-download').disabled = true;
|
||||
document.getElementById('live-title').innerHTML = '◉ Live Counter';
|
||||
document.getElementById('live-count').textContent = '--';
|
||||
document.getElementById('live-label').textContent = 'Objects Counted';
|
||||
@@ -478,6 +482,7 @@ function selectFile(path, name) {
|
||||
}
|
||||
selectedFile = path;
|
||||
document.getElementById('btn-start').disabled = false;
|
||||
document.getElementById('btn-download').disabled = false;
|
||||
loadFiles();
|
||||
loadBatchResult(path);
|
||||
}
|
||||
@@ -533,6 +538,16 @@ function formatSize(bytes) {
|
||||
return (bytes / 1073741824).toFixed(1) + ' GB';
|
||||
}
|
||||
|
||||
function downloadFile() {
|
||||
if (!selectedFile) return;
|
||||
var a = document.createElement('a');
|
||||
a.href = '/api/download-mp4?file=' + encodeURIComponent(selectedFile);
|
||||
a.download = selectedFile.split('/').pop();
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
}
|
||||
|
||||
// --- Streaming ---
|
||||
|
||||
async function startRecount() {
|
||||
|
||||
Reference in new issue
Block a user