Giter Club home page Giter Club logo

pandora_media_session's Introduction

Pandora Media Session Support

About

Extension and userscript implementing the Web Media Session API for Pandora Radio.

  • Allows for media notifications to integrate with Windows/Linux.
  • Supports showing the song title, artist, album, and album art.

There are two ways to install the script.

Extension Installation

  • Chrome users:
    • Click here to install from the Chrome Web Store website.
  • Edge Users:
    • Click here to install from the Edge-Addons website.
  • Opera Users:
    • Click here to install from the Chrome Web Store website.
  • Firefox Users:
    • Click here to install from the Firefox-Addons website.
  • Unpacked Extension:
    • Click here to download.

Userscript Installation

Step 1: Install a user-script manager

Step 2: Install the script

  • Click here to install the script.

Images

Example in Windows 10:

Windows 10 Media Session OSD

Example in Ubuntu:

Ubuntu Media Session OSD

Video

Watch the video

pandora_media_session's People

Contributors

snaphat avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

chrishsu2

pandora_media_session's Issues

Artwork doesn't always show-up in chromium-based browsers

In some cases when chromium-based browsers are backgrounded, the specific artwork will not display in the media-session.

This appears to be related to the issue mitigated in revision 2e0a50e where-in chromium-based browsers are (perhaps?) not sending updated metadata to the OS.

It seems the only work-around for this is to employ a similar trick to the above commit to force a refresh in some manner:

navigator.mediaSession.metadata = null

The issue with the former is that it causes very noticeable flashes in the media session display and cannot be employed at a 1s update interval to mitigate the issue as a result.

  • Directly modifying the src and type properties of the artwork property itself does not appear to force a refresh unlike with modifying title.
  • Directly modifying the sizes property or creating a new artwork object with a different sizes property appears to force a refresh.
navigator.mediaSession.metadata.title =  ... // this works if the title changes (the employed mitigation adds a space to the title every other update)

navigator.mediaSession.metadata.artwork.src = ... // this does not work even if the source changes
navigator.mediaSession.metadata.artwork.type = ... // this does not work even if the type changes

navigator.mediaSession.metadata.artwork.sizes = ... // this appears to work if the size changes

navigator.mediaSession.metadata.artwork = [
    {
        "sizes": ..., // this appears to work if the size changes
        "src": "https://mediaserver-cont-usc-mp1-1-v4v6.pandora.com/images/65/89/6b/0c/5dcc41b28ee9ba51bea415b9/500W_500H.jpg",
        "type": "image/jpeg"
    }
]

Doesn't work in Chrome (Windows 10) - Tried ViolentMonkey Script and Chrome Store Extension

I installed the script using ViolentMonkey, but it doesn't seem to work properly, even though it shows that it's active on Pandora. I also tried installing the Extension from the Chrome Store.

By default, Windows 10 + Chrome are working to Play/Pause Pandora, but not skip or repeat, so I was hoping this plugin would fix that. Artwork and Track info would be a nice bonus, too.

When active, both the ViolentMonkey script and the Chrome Extension break the limited play/pause control I already have, so I know they're affecting it; just not working properly. I tried using media controls while in a different window, in Chrome on another tab, and even at the Pandora webpage.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.