Convenient ways of opening external subtitles

Play video with external subtiles by:
* selecting and opening both video+subs from file chooser/manager
* dropping subtitles file on player window
* opening subtiles from file chooser/manager while video plays
* send their file path/uri to player via WebSocket message
This commit is contained in:
Rafał Dzięgiel
2021-04-07 13:52:51 +02:00
parent 28d8986072
commit b15b94fc90
7 changed files with 92 additions and 86 deletions

View File

@@ -12,10 +12,7 @@ class ClapperApp extends AppBase
{
super._init();
this.set_flags(
this.get_flags()
| Gio.ApplicationFlags.HANDLES_OPEN
);
this.flags |= Gio.ApplicationFlags.HANDLES_OPEN;
}
vfunc_startup()
@@ -39,26 +36,7 @@ class ClapperApp extends AppBase
{
super.vfunc_open(files, hint);
const { player } = this.active_window.get_child();
if(!this.doneFirstActivate)
player._preparePlaylist(files);
else
player.set_playlist(files);
this._openFiles(files);
this.activate();
}
_onWindowShow(window)
{
super._onWindowShow(window);
const { player } = this.active_window.get_child();
const success = player.playlistWidget.nextTrack();
if(!success)
debug('playlist is empty');
player.widget.grab_focus();
}
});