10

Kind of a random request, but something that would be cool nonetheless; would there be anyway I could make Spotify (and possibly iTunes etc.) pause when I start playing a YouTube video, and then start again once the video ends or I pause it?

Is there any software that would allow me to do this? Or a language that would be able to accomplish this?

64bit Windows 7

slhck
  • 223,558
  • 70
  • 607
  • 592
Sam
  • 230
  • 1
  • 3
  • 13

4 Answers4

4

I built mute.fm (http://www.mutefm.com/) to solve this problem. It works with iTunes, Spotify, and many other music players and will mute/pause it for YouTube or any other video or foreground sound.

Jared Sohn
  • 198
  • 9
1

Haven't tested it, but I think it's doable.

First, add this wrapper to your spotify: https://github.com/johanlindquist/jahspotify. This will give you a REST interface to control playback.

Now, create a chrome (I assume that's what you're using. If not, there are probably similar options for other browsers as well) extension that works for everything on YouTube's domain and add this: https://stackoverflow.com/q/8152814/1456578. Change the code to pause/resume spotify when a certain event happens on YT player.

As I'm intrested in a solution myself as well, I'll probably try it out sometime soon and will then update this answer with the results. Will most likely create/use a lightweight node server to wrap Spotify instead, because Tomcat seems like an overkill and all you (I) actually need is the play/pause functionality.

Deiwin
  • 111
  • 2
0

Opera GX now has this feature. The built in Music Player, which supports Spotify, YouTube Music and Apple Music, automatically pauses the music when you start watching a video and then automatically resumes when you finish.

David27
  • 1
  • 1
0

this python script works soo well on linux

https://gist.github.com/engelmarkus/fd81cd95775ffa365a58958e24829bd3

first make sure to install pulsectl pip install pulsectl

Spidy
  • 101
  • 2
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 31 '23 at 04:09