Skip to content
This repository has been archived by the owner on Jun 7, 2019. It is now read-only.

Unity webapps and Youtube #126

Closed
johnnynoone opened this issue Apr 18, 2013 · 9 comments
Closed

Unity webapps and Youtube #126

johnnynoone opened this issue Apr 18, 2013 · 9 comments

Comments

@johnnynoone
Copy link

After installing Youtube webapp on Ubuntu, I see album art and video title, just like YT was a music player. But previous/next buttons are insensitive (they don't do anything anyway, so that's not a problem), there is no pause button, and stop/play button doesn't do anything.

But play/pause do work correctly in Unity (sound menu). How hard would it be to make it work with your extension?

@eonpatapon
Copy link
Contributor

My extension looks at CanPause, CanNext, CanPrevious MPRIS properties. They might be set to False so that's why the buttons are insensitive.

@johnnynoone
Copy link
Author

Play/stop button is sensitive, but it doesn't work. Unity has play/pause and it works. Is it because Unity does is in some nonstandard way?

Controlling YouTube trough sound menu would be very useful for me, since I often use it as a music player and it sits in different tab group :)

@grawity
Copy link
Contributor

grawity commented Apr 25, 2013

Unity had a nonstandard "Ayatana Sound Menu" API, but later switched to MPRIS2, so it's unlikely that new software would use the custom API... especially if it already implements enough of MPRIS2 to show up in this extension.

Could you start Unity, run dbus-monitor type=method_call in a terminal, then use the Sound Menu's controls (play, pause, etc.), and copy here the monitor output?

(Maybe also try this mpris script (requires libnet-dbus-perl) – run mpris to list players, mpris <player> pause to pause, mpris <player> toggle to play/pause, mpris <player> next, and so on... and tell me which commands work with YouTube, and which don't?)

@eonpatapon
Copy link
Contributor

There is no pause button because CanPause is False so it fallback on the Play() method instead of using the PlayPause() method.

Maybe Play() is not implemented in this app. As @grawity said, dbus-monitor would help to see what's going on

@johnnynoone
Copy link
Author

It produces tons of output, I set terminal history to 1024 lines and it was not enough. I had to set unlimited! http://pastebin.com/EQqiyLs9

(Oh, I'm stupid. I could just redirect output to file...)

EDIT:
In the mpris script following commands work (I didn't try technical ones, like get/set/printf):
toggle
status
summary
raise
meta
And those don't throw errors, but have no visible effect:
activate
prev/next (even on playlist)

EDIT2:
Yes, can-pause is false, can-control is true.

Overall this "webapp" is buggy, even on Unity. When two youtube tabs are open, it goes crazy.

I have filed a bug: https://bugs.launchpad.net/ubuntu/+source/unity-webapps-youtube/+bug/1174682

@grawity
Copy link
Contributor

grawity commented Apr 30, 2013

Thanks. So the toggle subcommand in mpris calls PlayPause(), and I see Sound Menu calling the same method:

method call sender=:1.52 -> dest=org.mpris.MediaPlayer2.youtube serial=347
    path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=PlayPause

(":1.52" belongs to the Sound Menu according to these entries:
method call sender=:1.41 -> dest=:1.52 serial=688
    path=/com/canonical/indicator/sound/menu; interface=com.canonical.dbusmenu; member=GetLayout)

Which makes sense, since Sound Menu only has a single play/pause button, iTunes-style.

So it could actually be that the webapp didn't bother to implement separate Play() and Pause() methods... or even to return correct data for CanPause :(

Do I understand correctly that mpris youtube play and mpris youtube pause did not work for you either?

@johnnynoone
Copy link
Author

Yes

@grawity
Copy link
Contributor

grawity commented May 6, 2013

Then it's really a bug in the Youtube webapp, which violates the MPRISv2 spec by:

  1. not implementing Play() and Pause() methods (which are required);
  2. setting can-pause to "false" even though it supports pausing;
  3. allowing PlayPause() to be used while can-pause is set to "false".

@johnnynoone
Copy link
Author

OK, I've updated my bug report (linked above). I guess this can be closed now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants