mirror of
https://github.com/Rafostar/clapper.git
synced 2025-09-01 00:41:58 +02:00
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:
@@ -23,17 +23,27 @@ class ClapperPlayerRemote extends GObject.Object
|
||||
const uris = [];
|
||||
|
||||
/* We can not send GioFiles via WebSocket */
|
||||
for(let source of playlist) {
|
||||
const uri = (source.get_uri != null)
|
||||
? source.get_uri()
|
||||
: source;
|
||||
|
||||
uris.push(uri);
|
||||
}
|
||||
for(let source of playlist)
|
||||
uris.push(this._getSourceUri(source));
|
||||
|
||||
this.webclient.sendMessage({
|
||||
action: 'set_playlist',
|
||||
value: uris
|
||||
});
|
||||
}
|
||||
|
||||
set_subtitles(source)
|
||||
{
|
||||
this.webclient.sendMessage({
|
||||
action: 'set_subtitles',
|
||||
value: this._getSourceUri(source)
|
||||
});
|
||||
}
|
||||
|
||||
_getSourceUri(source)
|
||||
{
|
||||
return (source.get_uri != null)
|
||||
? source.get_uri()
|
||||
: source;
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user