Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Media ControlsNew to Visual Studio Code? Get it now.
Media Controls

Media Controls

Md Mostafijur Rahman

|
42 installs
| (0) | Free
Cross-platform media control for VS Code! Control any media player (Spotify, VLC, browsers) on Linux (MPRIS/D-Bus) and macOS (AppleScript) with smart tab detection, native app support, and zero external dependencies.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

🎵 Media Controls for VS Code

⚡ Lightning Fast: Direct platform-native communication means zero lag between you and your music
🎯 True Cross-Platform: Works with MPRIS on Linux and AppleScript on macOS - full native support
🧠 Smart Browser Integration: Intelligent tab detection and switching for seamless web media control

Your Code Deserves the Perfect Soundtrack

Transform your coding experience into a seamless symphony of productivity and passion!

Are you tired of constantly Alt+Tabbing to your browser or hunting through notification panels just to skip that one song that breaks your flow? Say goodbye to productivity-killing interruptions! This extension brings the power of media control directly to your fingertips, right where you live and breathe code.

🎧 Why Every Music-Loving Developer Needs This Extension:

✨ Stay in the Zone: Keep your hands on the keyboard and your mind in the code. No more context switching that shatters your concentration when you're deep in a complex algorithm.

🚀 Effortless Flow State: Seamlessly control your music without ever leaving VS Code. When the perfect coding track comes on, you'll know it – and when it's time to skip, you can do it instantly.

🎯 Zero Friction Productivity: Control any MPRIS-compatible media player (Chrome, Firefox, Spotify, VLC, and more) directly from your status bar. No external dependencies, no setup hassles – just pure coding bliss!

💡 Built for Developers, By Developers: We understand that great code is written to great music. This extension is crafted specifically for those magical moments when you're writing elegant functions, debugging complex logic, or architecting beautiful systems.

Because your coding sessions deserve better than constant interruptions for something as simple as changing a song.

Extension Icon

🌟 What Makes This Extension Essential for Coding Rockstars

Imagine this: You're deep in a complex debugging session, your favorite playlist is fueling your concentration, but suddenly a song comes on that doesn't match your coding rhythm. Instead of breaking your mental flow with Alt+Tab gymnastics or fumbling through notification panels, you simply click a button right in your status bar. That's the power of seamless productivity.

🎪 Your Personal Music Control Center

🎵 Instant Track Control: Play, pause, skip, and go back without ever touching another application
📟 Live Track Display: See what's playing right in your status bar – know your soundtrack
🎮 Dedicated Media Panel: Beautiful webview panel with album art, track info, and interactive controls
🎯 Activity Bar Integration: Quick access to your media player directly from VS Code's activity bar
🔄 Smart Player Selection: Automatically detects and prioritizes the best active media player
⚡ Lightning Fast: Direct D-Bus communication means zero lag between you and your music
🎯 Universal Compatibility: Works with any MPRIS-compatible player – browsers, Spotify, VLC, you name it
🔧 Zero Setup: Install and go – no dependencies, no configuration hassles

💻 Why Developers Love This Extension

"Finally, I can stay in my coding flow without music interruptions!" - Every developer after installing this

✅ Maintains Coding Focus: No more breaking your concentration for simple media controls
✅ Boosts Productivity: Studies show that removing small frictions can increase productivity by up to 40%
✅ Perfect for Deep Work: Ideal for those long coding sessions where every interruption costs precious mental energy
✅ Enhances Coding Sessions: Turn your development environment into a personalized, distraction-free workspace
✅ Multi-tasking Made Easy: Code, compile, debug, and control your music – all from one place

🔥 Latest Improvements

Enhanced for the modern developer workflow:

  • 🎛️ Progress Tracking & Seeking: Real-time progress bars with click-to-seek functionality for precise track control
  • 🔀 Shuffle & Repeat Controls: Toggle shuffle and repeat modes directly from the media panel
  • 📊 Enhanced UI: Interactive progress bars with time displays and smooth visual feedback
  • 🎯 Smart Media Control: Complete macOS support with AppleScript implementation and smart browser integration
  • � Intelligent Tab Detection: Automatically finds and switches to media-playing tabs in browsers
  • 🔧 Accessibility Integration: Built-in setup helper for macOS browser control permissions
  • 🌍 True Cross-Platform: Unified experience across Linux (MPRIS) and macOS (AppleScript)
  • 🚀 Zero Dependencies: Pure implementation - no external tools required on supported platforms!
  • 🔧 Universal Browser Support: Enhanced compatibility with Chrome, Safari, Brave, and Firefox on all platforms
  • 📦 Smart Error Handling: Intelligent diagnostics with clear, actionable solutions for each platform
  • 🌐 Plug & Play: Works with platform-native media APIs out of the box
  • 🛠️ Built-in Diagnostics: Troubleshooting tools and setup guides for seamless configuration
  • ⚡ Performance Optimized: Intelligent caching, lazy loading, and adaptive polling for minimal resource usage
  • 🎮 Dedicated Media Panel: Beautiful webview interface with album art, track info, and player selection
  • 🎯 Activity Bar Integration: Easily accessible media player panel from VS Code's activity bar
  • 🔄 Enhanced Player Detection: Smart player prioritization with improved cross-platform compatibility

🌍 Platform Support

Cross-platform media control with intelligent fallback:

Platform Status Implementation Features
🐧 Linux ✅ Fully Supported MPRIS D-Bus Complete feature set with all browsers and media players
🍎 macOS ✅ Fully Supported AppleScript Native apps + smart browser control with tab detection
🪟 Windows 🚧 In Development Media Session API System controls, UWP detection, PowerShell (planned)

Current Platform Features

🐧 Linux (Complete Implementation)

  • ✅ Full MPRIS compatibility with browsers, Spotify, VLC, and more
  • ✅ Smart player detection and prioritization
  • ✅ Album art, metadata, and seek functionality
  • ✅ Zero external dependencies
  • ✅ Real-time status updates and caching

🍎 macOS (Enhanced Implementation)

✅ Fully Supported Applications

Native Media Applications:

  • ✅ Apple Music/iTunes: Full control with rich metadata, album art, and real-time status
  • ✅ Spotify Desktop: Complete playback control, track information, and artwork
  • ✅ VLC Media Player: Basic playback controls
  • ✅ QuickTime Player: Basic playback controls

Web Browsers with Smart Tab Detection:

  • ✅ Google Chrome: Smart media tab detection and switching
  • ✅ Safari: Intelligent tab management for media content
  • ✅ Brave Browser: Advanced tab detection with media indicators
  • ✅ Firefox: Basic window-level control (limited by AppleScript API)

🎯 Advanced macOS Features

Smart Media Tab Detection:

  • ✅ Automatically finds tabs playing media (YouTube, Spotify Web, etc.)
  • ✅ Detects play/pause state from tab titles and URLs
  • ✅ Supports 25+ streaming platforms (YouTube Music, Netflix, Twitch, etc.)
  • ✅ Intelligent pattern matching for media indicators (▶, ⏸, 🔴)

Progress Tracking & Control:

  • ✅ Real-time Progress: Live track position with time displays
  • ✅ Interactive Seeking: Click progress bars for precise navigation
  • ✅ Advanced Controls: Shuffle and repeat modes for supported players
  • ✅ Rich Metadata: Full track information with duration and artwork

Browser Media Control:

  • ✅ Smart Tab Switching: Automatically switches to media-playing tab
  • ✅ Keyboard Shortcuts: Space (play/pause), Cmd+Arrow (next/previous)
  • ✅ Platform Detection: Works with YouTube, Spotify Web, SoundCloud, etc.
  • ✅ Title Parsing: Extracts artist and song from browser tab titles

Accessibility Integration:

  • ✅ Permission Management: Built-in accessibility settings helper
  • ✅ Error Guidance: Clear instructions for enabling browser control
  • ✅ Fallback Options: Graceful degradation when permissions unavailable

🔧 Requirements for macOS

For Native Apps (No Setup Required):

  • Just install and use - works immediately with Music, Spotify, VLC

For Browser Control (One-Time Setup):

  1. Enable Accessibility: System Preferences → Security & Privacy → Privacy → Accessibility
  2. Add VS Code: Click the lock, then "+" and add Visual Studio Code
  3. Alternative: Use the command Media Controls: Open Accessibility Settings for quick access

⚠️ macOS Limitations

Browser-Specific Limitations:

  • Firefox: Limited to window-level control (no individual tab access via AppleScript)
  • Private/Incognito: Some browsers restrict AppleScript access in private mode
  • Cross-Origin: Certain streaming sites may block external control
  • Progress Tracking: Browser players don't support progress bars or seeking (native apps do)

System Limitations:

  • Accessibility Required: Browser control needs one-time accessibility permission
  • AppleScript Dependency: Requires macOS AppleScript support (built-in)
  • No System Media Keys: Cannot simulate F7/F8/F9 media keys (by design)

💡 macOS Best Practices

For Optimal Experience:

  1. Use Native Apps: Spotify Desktop, Apple Music provide the richest control experience
  2. Enable Accessibility: One-time setup enables seamless browser control
  3. Keep Tabs Open: Media tabs need to remain open for control
  4. Use Dedicated Music Tabs: Separate tabs for music vs other content

Troubleshooting:

  • No Control: Check if accessibility permissions are enabled
  • Wrong Tab: Extension automatically finds and switches to media tab
  • Limited Features: Browser players have fewer features than native apps
  • Full Functionality: Use native applications for complete feature set

🪟 Windows (Planned Implementation)

  • 🚧 Platform-native media control integration
  • 🚧 Windows Media Session API support
  • 🚧 PowerShell-based player control
  • 🚧 UWP app media detection

🎯 Migration Note: The extension automatically detects your platform and provides the best available experience. macOS users now get full functionality with enhanced browser support!

🚀 Getting Started: Your Journey to Coding Nirvana

Ready to experience coding with the perfect soundtrack? Here's how simple it is:

⚡ Installation (2 seconds)

  • Install from VS Code Marketplace → Done!
  • Full Platform Support: Works immediately on Linux (MPRIS) and macOS (AppleScript)

🎵 Usage (Instant)

  • Start any supported media player (Chrome, Spotify, VLC, etc.)
  • Media controls appear in your status bar automatically
  • Click to control: ⏮️ Previous | ⏯️ Play/Pause | ⏭️ Next
  • NEW: Click the 🎵 music icon in the activity bar to open the dedicated media panel
  • NEW: Access the full-featured media panel with Ctrl+Alt+M
  • macOS: For browser control, enable accessibility permissions once (see setup below)

💪 Pro Power User Tips

  • Activity Bar Access: Click the 🎵 icon in the activity bar for instant media panel access
  • Media Panel: Ctrl+Alt+M → Open full-featured media player panel with advanced controls
  • Command Palette: Ctrl+Shift+P → Search "Media Controls" for all available commands
  • macOS Accessibility: Media Controls: Open Accessibility Settings → Quick setup for browser control
  • Smart Tab Detection (macOS): Extension automatically finds and switches to media-playing tabs
  • Player Selection: Dropdown in the media panel when multiple players are detected
  • Custom Keybindings: Set your own shortcuts (see configuration below)
  • Smart Player Detection: Automatically prioritizes playing content over paused content

🎨 The Developer Experience You Deserve

This isn't just another extension – it's a game-changer for how you experience coding.

🧠 Psychology of Productive Coding

  • Flow State Protection: Research shows it takes 23 minutes to regain deep focus after an interruption. This extension eliminates music-related context switching entirely.
  • Cognitive Load Reduction: One less thing to think about means more mental capacity for solving complex problems.
  • Mood-Code Synchronization: The right music at the right moment can turn debugging sessions into enjoyable puzzle-solving adventures.

� Why This Matters for Your Workflow

Eliminate Context Switching: No more Alt+Tab dance between your editor and music player. Your hands stay on the keyboard, your mind stays in the code.

Optimize Your Coding Rhythm: Different coding tasks need different energy levels. Quickly adjust your soundtrack when switching from intense debugging to creative architecting.

Maintain Deep Work Sessions: Long coding sessions require the right background audio. Control your environment without breaking concentration.

🎯 Perfect For These Coding Scenarios:

  • 📚 Learning new technologies: Keep your focus music playing while diving into documentation
  • 🐛 Debugging complex issues: Quickly adjust your music to match your problem-solving mood
  • ⚡ Rapid prototyping: Maintain momentum without breaking flow for music adjustments
  • 🏗️ Architecture planning: Control your thinking music without leaving your design tools
  • 🚀 Late-night coding sessions: Essential for those productive midnight coding marathons

Your code is your art. Your music is your inspiration. This extension is the bridge between them.

🎮 Dedicated Media Panel

Experience the future of music control in VS Code!

✨ Panel Features

🎨 Beautiful Interface: Modern, responsive design that adapts to VS Code themes
📸 Album Art Display: Shows cover art when available with fallback music note placeholder
📋 Track Information: Real-time display of song title, artist, and album
🎮 Interactive Controls: Full playback control including advanced features for supported players
🔄 Smart Player Selection: Dropdown to choose between multiple active players
🎵 Status Indicators: Color-coded dots showing playing/paused/stopped states

🚪 Accessing the Panel

Activity Bar: Click the 🎵 music icon for instant access
Keyboard: Ctrl+Alt+M opens the panel quickly
Command Palette: Search for "Media: Open Player Panel"

📊 Progress Tracking & Interactive Controls

Transform your music control experience with real-time progress tracking and seeking!

🎯 Progress Features

📊 Real-Time Progress: Live progress bars showing exact track position and duration
🎮 Click-to-Seek: Click anywhere on the progress bar to jump to that position instantly
⏱️ Time Displays: See current position and total duration (e.g., "2:34 / 4:12")
🔀 Shuffle Control: Toggle shuffle mode with visual indicators
🔁 Repeat Control: Toggle repeat mode for continuous playback
🎨 Smart UI: Progress bars automatically disable for unsupported players

🌟 Supported Features by Player Type

Native Apps (Full Support):

  • ✅ macOS: Music, iTunes, Spotify Desktop, VLC, QuickTime Player
  • ✅ Progress Tracking: Real-time position updates
  • ✅ Seeking: Click-to-seek to any position
  • ✅ Shuffle & Repeat: Toggle controls (Music, iTunes, Spotify only)
  • ✅ Rich Metadata: Full track info with artwork and duration

Browser Players (Basic Support):

  • ✅ All Platforms: Chrome, Safari, Firefox, Brave
  • ✅ Playback Control: Play, pause, next, previous
  • ✅ Smart Tab Detection: Automatic media tab switching
  • ⚠️ Limited Features: No progress tracking or seeking (browser API limitations)

💡 Pro Tips for Progress Features

🎯 For Best Experience: Use native apps (Spotify Desktop, Apple Music) for full progress functionality
⚡ Quick Seeking: Click anywhere on the progress bar - no dragging needed!
🔄 State Persistence: Shuffle and repeat states are remembered across tracks
📱 Visual Feedback: Active shuffle/repeat buttons show colored indicators
🚫 Smart Fallbacks: Features automatically disable for unsupported players### 🔧 Panel Intelligence

Automatic Player Detection: Prioritizes actively playing content over paused
Progress Support Detection: Automatically enables/disables seek functionality based on player capabilities
Transition Handling: Smooth transitions between tracks without flickering
Multi-Player Support: Easy switching between browsers, Spotify, VLC, and more
Real-Time Updates: Live track info, progress, and status updates every 1-2 seconds
Smart Control States: Shuffle and repeat buttons adapt to player support

⚙️ Configuration & Customization

🎛️ Settings

In VS Code settings, search for mediaControls:

Core Settings:

  • mediaControls.playerName: Target specific player (optional - auto-detects by default)
  • mediaControls.pollIntervalMs: Status bar update frequency (default: 3000ms)
  • mediaControls.cacheTimeoutMs: Cache timeout for player data (default: 3000ms)

Media Panel Settings:

  • mediaControls.panel.autoOpen: Automatically open panel when player detected (default: true)
  • mediaControls.panel.showLyrics: Show lyrics section when available (default: true)

🍎 macOS Setup Guide

For Native Apps (No Setup Required)

Just install and use - works immediately with Apple Music, Spotify Desktop, VLC, etc.

For Browser Control (One-Time Setup)

Quick Setup:

  1. Run command: Media Controls: Open Accessibility Settings
  2. Click "Add" and select Visual Studio Code
  3. Restart VS Code if needed

Manual Setup:

  1. Open System Preferences → Security & Privacy → Privacy → Accessibility
  2. Click the lock icon (🔒) and enter your password
  3. Click "+" and navigate to Applications → Visual Studio Code
  4. Ensure VS Code has a checkmark next to it
  5. Restart VS Code for changes to take effect

Why This Is Needed:

  • macOS requires permission for apps to send keystrokes to other applications
  • This enables seamless browser media control (spacebar, arrow keys, etc.)
  • Without this, you'll get helpful error messages with alternative solutions

Supported Browser Features with Accessibility:

  • ✅ Smart tab detection and automatic switching
  • ✅ Play/pause with spacebar
  • ✅ Next/previous track with Cmd+Arrow keys
  • ✅ Automatic media platform detection (YouTube, Spotify Web, etc.)

⌨️ Custom Keybindings

Add these to your keybindings.json for keyboard mastery:

{
    "key": "ctrl+alt+p",
    "command": "mediaControls.playPause",
    "when": "!terminalFocus"
},
{
    "key": "ctrl+alt+]",
    "command": "mediaControls.next",
    "when": "!terminalFocus"
},
{
    "key": "ctrl+alt+[",
    "command": "mediaControls.previous",
    "when": "!terminalFocus"
},
{
    "key": "ctrl+alt+m",
    "command": "mediaControls.openPanel",
    "when": "!terminalFocus"
},
{
    "key": "ctrl+alt+s",
    "command": "mediaControls.openAccessibilitySettings",
    "when": "!terminalFocus && isMac"
}

💡 Pro Tip: These shortcuts work alongside your existing VS Code keybindings without conflicts!

🛠️ Troubleshooting

Platform Support Quick Check

Check your platform support:

  • Use the command Media: Show Performance Stats to see your platform and implementation details
  • Linux users: Get full MPRIS support with all browsers and media players
  • macOS users: Get full AppleScript support with native apps + enhanced browser control

Quick Fixes by Platform

🐧 Linux Issues

Status Bar Issues:

  • No controls visible? Start a media player and play something
  • Using snap browsers? They have security restrictions - try installing from APT/DEB instead

Extension Issues:

  • Extension not working after update? Try reloading VS Code window (Ctrl+Shift+P → "Developer: Reload Window")

🍎 macOS Issues

Browser Control Issues:

  • "Accessibility permissions needed" error? Enable accessibility for VS Code:
    1. System Preferences → Security & Privacy → Privacy → Accessibility
    2. Click the lock icon and add Visual Studio Code
    3. Or use command: Media Controls: Open Accessibility Settings

Media Detection Issues:

  • Controls not finding media? Make sure you're actively playing content in supported browsers
  • Wrong tab being controlled? Extension automatically detects and switches to media-playing tabs
  • Limited metadata in browsers? This is normal - browsers provide title only vs full artist/album

Player Priority Issues:

  • Extension picking wrong player? It prioritizes: 1) Playing content, 2) Native apps, 3) Browsers
  • Want to use specific player? Use the dropdown in the media panel to manually select

🌐 Universal Issues

Media Panel Issues:

  • Panel not opening? Check that the 🎵 icon appears in the activity bar
  • No track info showing? Ensure your player is actively playing content
  • Album art not loading? Not all players provide album art - this is normal
  • Limited functionality? Native apps provide more features than browser players
  • Multiple players detected? Use the dropdown in the panel to select your preferred player

Platform-Specific Guidance

Linux Snap Package Limitations

Ubuntu users: Snap browsers (Firefox, Chrome, Brave) may have limited functionality due to AppArmor security policies.

💡 Solutions for Linux users:

Option 1: Install a second browser (recommended)

# Install Firefox via APT alongside your snap version
sudo add-apt-repository ppa:mozillateam/ppa
sudo apt update && sudo apt install firefox

# Install Brave via APT alongside your snap version
sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave-browser-release.list
sudo apt update && sudo apt install brave-browser

Option 2: Use dedicated music players

  • Spotify desktop app, VLC, Rhythmbox work perfectly without browser limitations

macOS Accessibility Setup

One-time setup for browser control:

  1. Quick Setup: Use VS Code command Media Controls: Open Accessibility Settings
  2. Manual Setup:
    • Open System Preferences → Security & Privacy → Privacy → Accessibility
    • Click the lock icon (🔒) and enter your password
    • Click "+" and add Visual Studio Code
    • Restart VS Code if needed

Why accessibility is needed:

  • macOS requires permission for apps to send keystrokes to other applications
  • This enables browser media control (spacebar for play/pause, etc.)
  • Native apps (Spotify, Music) work without any special permissions

Alternative without accessibility:

  • Use native music apps: Spotify Desktop, Apple Music, VLC
  • Use keyboard shortcuts directly in browsers:
    • Spacebar: Play/Pause
    • Cmd+Right Arrow: Next track
    • Cmd+Left Arrow: Previous track

🌟 Need Help or Want to Share Your Experience?

Ready to transform your development experience?

🎵 Install Now: Search for "Media Controls" in the VS Code Extensions marketplace

💡 Questions or Troubleshooting?

  • Check Platform Support: Use Media: Show Performance Stats command to see platform details and implementation status
  • Linux Users: Check MPRIS support with gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.ListNames | grep mpris
  • macOS Users: Use Media Controls: Open Accessibility Settings for quick browser control setup
  • All Platforms: Check the dedicated media panel by clicking the 🎵 icon in the activity bar
  • General Issues: Try reloading VS Code if the extension seems unresponsive

⭐ Love the enhanced media control experience with interactive features?

  • Leave a rating or review, report issues, and share your ideas or stories on the Media Controls for VS Code Marketplace page. Your feedback helps fellow developers and inspires future improvements!
  • All Users: Share your favorite coding playlists and how the enhanced controls transform your development experience!

Because great code deserves great music, and great music deserves effortless control.

Happy coding, and may your functions be bug-free and your playlists be perfect! 🎵👨‍💻👩‍💻


License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft