API: add toggle_play method

This commit is contained in:
Rafał Dzięgiel
2021-04-26 14:21:33 +02:00
parent e92ad68220
commit c6e8824e3b
3 changed files with 26 additions and 9 deletions

View File

@@ -355,15 +355,6 @@ class ClapperPlayer extends GstClapper.Clapper
controls.volumeScale.set_value(volume);
}
toggle_play()
{
const action = (this.state === GstClapper.ClapperState.PLAYING)
? 'pause'
: 'play';
this[action]();
}
next_chapter()
{
return this._switchChapter(false);