mozilla-extensions / firefox-voice

Firefox Voice is an experiment in a voice-controlled web user agent
Mozilla Public License 2.0
285 stars 122 forks source link

"Play" command for Spotify will autoplay previous artist/song #404

Open alexandra-martin opened 4 years ago

alexandra-martin commented 4 years ago

Prerequisites:

Mic and autoplay permissions are enabled.

STR:

  1. Use the shortcut or click on the mic icon from the browser toolbar.
  2. Say or write a "Play" command for Spotify, e.g. "Play Green Day".

Expected result:

A Spotify tab opens in a new tab and starts playing Green Day related music in the background.

Actual result:

A Spotify tab opens in a new tab and starts playing previous command related music in the background .

Notes:

Reproduced on Mac 10.14.6 and Win 10x64 with Firefox Nightly 71.0a1 (64-bit). If the "Play Green Day" command is made again in the Spotify tab, Green Day related music will start playing.

a

ianb commented 4 years ago

I'm not entirely sure what's going on here, you'll want to look in spotify.js and spotify/player.js and add some debugging messages to try to track down why this isn't working. Maybe it's playing before the search has completed? Maybe it's failing to do a new search?

Manasa2850 commented 4 years ago

Could you please assign this to me?

Manasa2850 commented 4 years ago

@ianb I'm not able to see the result mentioned by @alexandra-martin . When I search again, the previous song is not played. Instead, I get an error like this spotify

ianb commented 4 years ago

@Manasa2850 So it looks like spotify/player.js has a very specific selector it is using, that probably works sometimes but not all the time. Or maybe it's broken all the time, though I don't think so.

You can try looking at that query, and figuring out what part is breaking it (e.g., #searchPage ?) and what the right selector would be. Ideally it should click the play button that shows up when you hover over Martin Garrix, though it might currently be attempting to play the first result under "Songs".

alexandra-martin commented 4 years ago

@Manasa2850 since this bug is pretty old, it's possible this was fixed along the way, or it may appear intermittently. The error you got is related to #1189.