Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

playback.setCurrentTime doesn't work in Chrome extension #17

Open
x3haloed opened this issue Feb 27, 2017 · 3 comments
Open

playback.setCurrentTime doesn't work in Chrome extension #17

x3haloed opened this issue Feb 27, 2017 · 3 comments

Comments

@x3haloed
Copy link

I'm trying to build a Chrome extension for controlling Google Play Music. I have a content script that includes the gmusic.js library. I'm able to successfully call playback.playPause(), playback.getCurrentTrack(), and extras.getTrackURL(), but playback.setCurrentTime() doesn't seem to be working as expected.

When I run the following code, I expect the playback time to be set to 60 seconds:

gmusic = new GMusic();
gmusic.playback.setPlaybackTime(60000);

Instead, I hear a momentary disruption in play, and it continues to play from where it was before.

The console does not show any JavaScript errors.

Any idea what I could be doing wrong?

@jostrander
Copy link
Member

Could be a bug, I don't think we use that regularly except for the web socket API upstream in GPMDP. Will need to repo before confirming.

@MarshallOfSound
Copy link
Member

Works fine still inside GPMDP 👍

@x3haloed
Copy link
Author

x3haloed commented Mar 25, 2017

I'm still interested in getting gmusic.js working from a Chrome extension. I figured I should give you an example instead of just complaining. I've attached a sample, barebones Chrome extension with gmusic.js.

gmusic-js-bug.zip

To test:

  1. load it up into Chrome and enable it
  2. browse to play.google.com/music
  3. open the Chrome console
  4. play a song
  5. click the extension icon
  6. notice that the console logs "Setting current time to 1 minute..." and then the song skips a moment and continues playing from it's current position. The code has called gmusic.playback.setPlaybackTime(60000); at this point, and the track should be playing from the 1m mark.

I am running Chrome 56.0.2924.87 (64-bit) on macOS Sierra 10.12.3

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

No branches or pull requests

3 participants