mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-25 19:32:54 +00:00
24 lines
482 B
JavaScript
24 lines
482 B
JavaScript
![]() |
.pragma library
|
||
|
|
||
|
var control = service("mpris2", "@multiplex");
|
||
|
|
||
|
function associateItem(item, name)
|
||
|
{
|
||
|
control.associateItem(item, name);
|
||
|
}
|
||
|
|
||
|
function callCommand(name)
|
||
|
{
|
||
|
control.startOperationCall(control.operationDescription(name));
|
||
|
}
|
||
|
|
||
|
function seek(timeMs)
|
||
|
{
|
||
|
var desc = control.operationDescription('SetPosition');
|
||
|
desc.microseconds = Math.floor(timeMs * 1000);
|
||
|
print("Seeking to " + timeMs + "ms");
|
||
|
control.startOperationCall(desc);
|
||
|
}
|
||
|
|
||
|
// vi:sts=4:sw=4:et
|