mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-31 00:11:59 +02:00
Hide track selection buttons without contents
This commit is contained in:
@@ -185,16 +185,23 @@ class ClapperInterface extends Gtk.Grid
|
|||||||
for(let type of ['video', 'audio', 'subtitle']) {
|
for(let type of ['video', 'audio', 'subtitle']) {
|
||||||
let currStream = this._player[`get_current_${type}_track`]();
|
let currStream = this._player[`get_current_${type}_track`]();
|
||||||
let activeId = (currStream) ? currStream.get_index() : -1;
|
let activeId = (currStream) ? currStream.get_index() : -1;
|
||||||
|
let buttonBox = this.controls[`${type}TracksButton`].get_parent();
|
||||||
|
|
||||||
if(currStream && type !== 'subtitle') {
|
if(currStream && type !== 'subtitle') {
|
||||||
let caps = currStream.get_caps();
|
let caps = currStream.get_caps();
|
||||||
debug(`${type} caps: ${caps.to_string()}`, 'LEVEL_INFO');
|
debug(`${type} caps: ${caps.to_string()}`, 'LEVEL_INFO');
|
||||||
}
|
}
|
||||||
|
if(!parsedInfo[`${type}Tracks`].length) {
|
||||||
|
debug(`hiding popover button without contents: ${type}`);
|
||||||
|
buttonBox.hide();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
this.controls.addRadioButtons(
|
this.controls.addRadioButtons(
|
||||||
this.controls[`${type}TracksButton`].popoverBox,
|
this.controls[`${type}TracksButton`].popoverBox,
|
||||||
parsedInfo[`${type}Tracks`],
|
parsedInfo[`${type}Tracks`],
|
||||||
activeId
|
activeId
|
||||||
);
|
);
|
||||||
|
buttonBox.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user