Pause iTunes for YouTube
March 26, 2010 1:09 PM   Subscribe

I'm a lazy bastard who spends a lot of time on the computer. I'm running Snow Leopard right now, and I want to know if there's a quick, easy way to pause iTunes when I start watching a YouTube video.

Constantly switching to the iTunes app to pause my music before playing videos is a pain in the ass (like I said, I'm a lazy bastard). The controller widget takes too long to come up as well.

Is there a way I can configure things to automatically pause iTunes when I start a YouTube video and resume when I stop watching? Failing that, is there another quick way to pause iTunes when I want to watch a YouTube video?
posted by Despondent_Monkey to Computers & Internet (12 answers total) 1 user marked this as a favorite
Couldn't you just pause itunes with the keyboard shortcut?
posted by special-k at 1:10 PM on March 26, 2010 [1 favorite]

this thread seems to have suggestions for making the process shorter, but not automatic.
posted by nadawi at 1:12 PM on March 26, 2010

also, my solution would be alt+tab spacebar alt+tab (command+tab in osx, i think)
posted by nadawi at 1:14 PM on March 26, 2010 [1 favorite]

If you don't have the newer keyboards with the play/pause button F8, you could buy Synergy and use that.
posted by hariya at 1:16 PM on March 26, 2010 [1 favorite]

I use Quicksilver, which has plugins for iTunes built into it, and I've set a trigger (keystroke) to pause iTunes, and I can use it regardless of whatever program I'm in.
posted by rtha at 1:18 PM on March 26, 2010

If you use Firefox, you can install the add-on FoxyTunes, which automatically switches players to whatever you're using (Pandora, iTunes, YouTube). You can hit the pause button any time from the little control bar on your browser, so no more switching windows and finding iTunes to hit "pause". I use it all the time for this purpose.
posted by wundermint at 1:42 PM on March 26, 2010

I use SizzlingKeys and have play/pause mapped to control-space.
posted by Guy Smiley at 1:49 PM on March 26, 2010

any mac that can run snow leopard should have itunes shortcut keys built in, no?
posted by CharlesV42 at 1:51 PM on March 26, 2010

How's your Applescript? I've been thinking of a way to automatically pause iTunes when you play a YouTube video, and start it again when the video's over. This idea's still half-baked but if you're not afraid to dabble in some code you could end up with something pretty hardcore...

1. Get Rogue Amoeba's Audio Hijack Pro.
2. Set it up to constantly hijack your browser (Firefox, Safari, whatever) and record all audio from that application. All you need to do is detect a signal, so keep the file sizes small with the lowest quality option.
3. This is the tricky part. Write an Applescript to toggle iTunes playback. If you want to get fancy, include some logic to check if you've got iTunes open and/or if you've been listening lately (to avoid playing stuff when you don't want it). If you want to get really fancy, make the audio volume fade in and out.
4. Tell Audio Hijack Pro to execute the script whenever it detects silence.

Don't forget, your script also needs to automatically clean out the recordings folder whenever it's run, so you don't fill up your hard drive with crappy audio from all your web surfing.

As far as I can tell, Audio Hijack Pro can only run scripts when it detects silence, not when it detects noise. You might be able to find a way around that, or maybe it'll just require you to click the YouTube "play" button twice to get iTunes to behave. That may or may not be enough of a pain to invalidate this whole idea. See what you can come up with. Maybe email Rogue Amoeba and ask for help — they're friendly folks.

If you dare to try this solution, MeMail me if you can get it to work. I'd love to automate my iTunes pausing and unpausing whenever something in my browser makes noise. (Somebody on MeFi, I think, recently posted a link to a comic about a guy who always forgets to turn his music back on after a YT video until he realizes he's been sitting in silence for several hours. I do this all the time!)
posted by The Winsome Parker Lewis at 2:28 PM on March 26, 2010

I just use the mini-player, so that itunes is always visible in the lower right-hand corner of the screen. I, too, am Lazy, but hitting that pause button on the mini-player is pretty painless.
posted by lunasol at 2:40 PM on March 26, 2010

I 2nd SizzlingKeys. Install it, set it, done
posted by chillmost at 3:15 PM on March 26, 2010

Because I'm a rather persistent sort of nerd, an alternate method to the one I mentioned has occurred to me:

1. Follow these directions to control iTunes via PHP (you can run a web server on your Mac without making the controls available to the whole world).
2. Read up on the YouTube JavaScript API.
3. This method has a tricky part too... find a way, perhaps with Greasemonkey, to determine the current playback state of any open YT videos, and send the appropriate requests to your iTunes remote as needed.

In theory this would be a lot more reliable than my other suggestion, though it would only work for YouTube instead of responding to any audio playing from your browser.
posted by The Winsome Parker Lewis at 3:58 PM on March 26, 2010

« Older SFBay industrial surplus?   |   What language is this? Newer »
This thread is closed to new comments.