Napster / napster.js

Napster Javascript SDK
MIT License
56 stars 44 forks source link

the play() request was interrupted by a call to pause() #30

Open hmpmarketing opened 4 years ago

hmpmarketing commented 4 years ago

Hi,

I would like to leave some feedback about an issue I have noticed with the napster.js sdk.

It seems some songs when not available in 192 bit rate ( I assume) will trigger this error when trying to call Napster..player.play()

"the play() request was interrupted by a call to pause()"

I took some time to look at napster.js and starting on line 56, this bit of code:

this.streamingPlayer = new DrmStreamingPlayer({ id: "napster-streaming-player", apikey: h, token: m.member.accessToken, bitrate: 192, downgrade: !0, currentUser: {}, env: "production" })

There is a hardcoded option for bitrate at 192.

By changing this value to something like 64, the SDK was able to play songs at different bitrates, just dont know whats done internally to select, but some songs will play at 320 or 192.

Anyway to take a look at this and see why this error happens for certain songs?