Skip to content

The swiss army knife of lossless video/audio editing

Show file title in window title

Mikael Finstad8edf9446f375
diff --git a/src/renderer.jsx b/src/renderer.jsx
index 941afad5..5a2f6acd 100644
--- a/src/renderer.jsx
+++ b/src/renderer.jsx
@@ -3,6 +3,7 @@ const $ = require('jquery');
const keyboardJs = require('keyboardjs');
const _ = require('lodash');
const Hammer = require('react-hammerjs');
+const path = require('path');
const React = require('react');
const ReactDOM = require('react-dom');
@@ -14,6 +15,11 @@ const util = require('./util');
const dialog = electron.remote.dialog;
+function setFileNameTitle(filePath) {
+ const appName = 'LosslessCut';
+ document.title = `${appName} - ${path.basename(filePath)}`;
+}
+
function getVideo() {
return $('#player video')[0];
}
@@ -108,6 +114,7 @@ class App extends React.Component {
return ffmpeg.getFormat(filePath)
.then((fileFormat) => {
if (!fileFormat) return alert('Unsupported file');
+ setFileNameTitle(filePath);
return this.setState({ filePath, fileFormat });
})
.catch((err) => {