[SOLVED] Need help for setting boolean value of a mpris property for vlc

Forum rules
Before you post please read how to get help
Post Reply
User avatar
secureIT
Level 3
Level 3
Posts: 178
Joined: Wed Dec 05, 2018 1:26 pm

[SOLVED] Need help for setting boolean value of a mpris property for vlc

Post by secureIT » Wed Sep 04, 2019 7:59 am

LM 19.2 Xfce 64 bit

Dear Friends,

I want to set a running instance of VLC with a qdbus-command to fullscreen.

Terminal output for :

Code: Select all

qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2
is :

Code: Select all

property read bool org.mpris.MediaPlayer2.CanQuit
property read bool org.mpris.MediaPlayer2.CanRaise
property read bool org.mpris.MediaPlayer2.CanSetFullscreen
property read QString org.mpris.MediaPlayer2.DesktopEntry
property readwrite bool org.mpris.MediaPlayer2.Fullscreen
property read bool org.mpris.MediaPlayer2.HasTrackList
property read QString org.mpris.MediaPlayer2.Identity
property read QStringList org.mpris.MediaPlayer2.SupportedMimeTypes
property read QStringList org.mpris.MediaPlayer2.SupportedUriSchemes
method void org.mpris.MediaPlayer2.Quit()
method void org.mpris.MediaPlayer2.Raise()
property read bool org.mpris.MediaPlayer2.Player.CanControl
property read bool org.mpris.MediaPlayer2.Player.CanPause
property read bool org.mpris.MediaPlayer2.Player.CanPlay
property read bool org.mpris.MediaPlayer2.Player.CanSeek
property readwrite QString org.mpris.MediaPlayer2.Player.LoopStatus
property readwrite double org.mpris.MediaPlayer2.Player.MaximumRate
property read QVariantMap org.mpris.MediaPlayer2.Player.Metadata
property readwrite double org.mpris.MediaPlayer2.Player.MinimumRate
property read QString org.mpris.MediaPlayer2.Player.PlaybackStatus
property read int org.mpris.MediaPlayer2.Player.Position
property readwrite double org.mpris.MediaPlayer2.Player.Rate
property readwrite double org.mpris.MediaPlayer2.Player.Shuffle
property readwrite double org.mpris.MediaPlayer2.Player.Volume
method void org.mpris.MediaPlayer2.Player.Next()
method void org.mpris.MediaPlayer2.Player.OpenUri(QString)
method void org.mpris.MediaPlayer2.Player.Pause()
method void org.mpris.MediaPlayer2.Player.Play()
method void org.mpris.MediaPlayer2.Player.PlayPause()
method void org.mpris.MediaPlayer2.Player.Previous()
method void org.mpris.MediaPlayer2.Player.Seek(qlonglong)
method void org.mpris.MediaPlayer2.Player.SetPosition(QDBusObjectPath, qlonglong)
method void org.mpris.MediaPlayer2.Player.Stop()
property read bool org.mpris.MediaPlayer2.TrackList.CanEditTracks
property read QList<QDBusObjectPath> org.mpris.MediaPlayer2.TrackList.Tracks
signal void org.mpris.MediaPlayer2.TrackList.TrackAdded(QVariantMap, QDBusObjectPath)
signal void org.mpris.MediaPlayer2.TrackList.TrackListReplaced(QList<QDBusObjectPath>, QDBusObjectPath)
signal void org.mpris.MediaPlayer2.TrackList.TrackMetadataChanged(QDBusObjectPath, QVariantMap)
signal void org.mpris.MediaPlayer2.TrackList.TrackRemoved(QDBusObjectPath)
method void org.mpris.MediaPlayer2.TrackList.AddTrack(QString, QDBusObjectPath, bool)
method {D-Bus type "aa{sv}"} org.mpris.MediaPlayer2.TrackList.GetTracksMetadata(QList<QDBusObjectPath>)
method void org.mpris.MediaPlayer2.TrackList.GoTo(QDBusObjectPath)
method void org.mpris.MediaPlayer2.TrackList.RemoveTrack(QDBusObjectPath)
As i saw in d-feet, the :

Code: Select all

property read bool org.mpris.MediaPlayer2.CanSetFullscreen
value is at : true

The :

Code: Select all

property readwrite bool org.mpris.MediaPlayer2.Fullscreen
shows up with true or false when toggled with gui.

As the property is read/write , i tried to toggle it with qdbus-command.

I tried it with:

Code: Select all

qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Fullscreen value ^= true
and

Code: Select all

qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Fullscreen false = !true;
and got :

Code: Select all

Cannot find 'org.mpris.MediaPlayer2.Fullscreen' in object /org/mpris/MediaPlayer2 at org.mpris.MediaPlayer2.vlc
with :

Code: Select all

qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Fullscreen a = !a;
i got:

Code: Select all

qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Fullscreen a = axVLCPlugin21.video.fullscreen = true;
Cannot find 'org.mpris.MediaPlayer2.Fullscreen' in object /org/mpris/MediaPlayer2 at org.mpris.MediaPlayer2.vlc
so i tried :

Code: Select all

qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Fullscreen axVLCPlugin21.video.fullscreen = true;
but no luck at all.

So now i wonder, what is the right syntax to toggle this boolean value.

I would be very grateful for any help
Last edited by secureIT on Thu Sep 05, 2019 8:39 am, edited 1 time in total.
In der Ruhe liegt die Kraft ! .......... The strenght is to be found in serenity !

rene
Level 12
Level 12
Posts: 4270
Joined: Sun Mar 27, 2016 6:58 pm

Re: Need help for setting boolean value of a mpris property for vlc

Post by rene » Thu Sep 05, 2019 4:56 am

secureIT wrote:
Wed Sep 04, 2019 7:59 am
As i saw in d-feet, the :

Code: Select all

property read bool org.mpris.MediaPlayer2.CanSetFullscreen
value is at : true
[/code]
Are you sure, because for me it is not. Mint 19.2 Cinnamon:

Code: Select all

$ qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.CanSetFullscreen
false
As per https://specifications.freedesktop.org/ ... layer.html calling Fullscreen itself indeed does not do anything, then.

User avatar
secureIT
Level 3
Level 3
Posts: 178
Joined: Wed Dec 05, 2018 1:26 pm

Re: Need help for setting boolean value of a mpris property for vlc

Post by secureIT » Thu Sep 05, 2019 5:38 am

Hi rene,

thanks for your answer.

If you open up vlc without playing media then value of CanSetFullscreen is false by default.

Thats logical, while not playing anything, there is nothing to set to fullscreen.

If you open vlc and play media the value will toggle to : true.

To make it clearer

what i tried is :

Having a running vlc instance with opened stream > qdbus-command > toggle to fullscreen
In der Ruhe liegt die Kraft ! .......... The strenght is to be found in serenity !

rene
Level 12
Level 12
Posts: 4270
Joined: Sun Mar 27, 2016 6:58 pm

Re: Need help for setting boolean value of a mpris property for vlc

Post by rene » Thu Sep 05, 2019 8:13 am

secureIT wrote:
Thu Sep 05, 2019 5:38 am
Thats logical, while not playing anything, there is nothing to set to fullscreen.
Given that F11 directly from the interface works both while playing and while not I'd not in fact call that logical, but the issue here is that both CanSetFullScreen and FullScreen are properties; need to be accessed via org.freedesktop.DBus.Properties.Get/Set. Directly via dbus-send:

Code: Select all

$ dbus-send --dest=org.mpris.MediaPlayer2.vlc --print-reply /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:org.mpris.MediaPlayer2 string:CanSetFullscreen
method return time=1567684990.465691 sender=:1.196 -> destination=:1.313 serial=30 reply_serial=2
   variant       boolean true
$ dbus-send --dest=org.mpris.MediaPlayer2.vlc --print-reply /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Set string:org.mpris.MediaPlayer2 string:Fullscreen variant:boolean:true
method return time=1567685002.235279 sender=:1.196 -> destination=:1.314 serial=31 reply_serial=2
$ dbus-send --dest=org.mpris.MediaPlayer2.vlc --print-reply /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Set string:org.mpris.MediaPlayer2 string:Fullscreen variant:boolean:false
method return time=1567685012.265839 sender=:1.196 -> destination=:1.315 serial=33 reply_serial=2
Works well here. I never use qdbus and the obvious, direct transcription of the above does not seem to work, so if you insist on qdbus, I'll leave that up to you...

User avatar
secureIT
Level 3
Level 3
Posts: 178
Joined: Wed Dec 05, 2018 1:26 pm

Re: Need help for setting boolean value of a mpris property for vlc

Post by secureIT » Thu Sep 05, 2019 8:38 am

Thats it !

Thank you very much :D
In der Ruhe liegt die Kraft ! .......... The strenght is to be found in serenity !

Post Reply

Return to “Scripts & Bash”