napster / napster.js Goto Github PK
View Code? Open in Web Editor NEWNapster Javascript SDK
License: MIT License
Napster Javascript SDK
License: MIT License
Hi,
When running the React example (nice work btw), I'm getting the following error in the console when I try selecting certain tracks and they fail to play:
In Chrome: Unexpected token T in JSON at position 0 - streaming-player-1.0.1.js
In Safari: JSON Parse error: Unexpected identifier "The" - streaming-player-1.0.1.js
Some tracks work OK, but here are a few problematic tracks I've spotted so far:
Metal Genre - Paranoid - Black Sabbath
Metal Genre - Here I Go Again - Whitesnake
Metal Genre - Nothing Else Matters - Metallica
Alternative Genre - Mr. Brightside - The Killers
They play fine on the live napster.com site. Any thoughts what the issue is?
Please add a metadata flag to mark all inappropriate images.
For example this image is highly inappropriate to show up on someones 24" monitor at work.
Please associate the attribute NSFW to every image like this:
This way we may blur the image if the user is using Napster in a sensitive environment.
Here's more about NSFW
https://en.wikipedia.org/wiki/Not_safe_for_work
This error is in console:
Cross-origin plugin content from https://api.napster.com/v1.1/player/player.swf must have a visible size larger than 400 x 300 pixels, or it will be blocked. Invisible content is always blocked.
It has been reported that in Firefox browsers, because the init
function sets the display style to none
(see line 83), playback will never be enabled because the ready
event will never be received.
I am experiencing the following error in the console. I'm following the API documentation as described in the readme. I've tried basic fixes like moving the code around in certain areas of the HTML, a script.js and in the actual napster.min.js. I've isolated the conflict to the .set method. "napster.min.js:15" refers to "Napster.member.set({.....".
napster.min.js:4 Uncaught ReferenceError: DrmStreamingPlayer is not defined
at e.auth (napster.min.js:4)
at l.<anonymous> (napster.min.js:4)
at l.a.(anonymous function) [as set] (file:///C:/Users/Ibrahim%20Iqbal/Desktop/Bootcamp%20Homework/Project-1/assets/javascript/napster.min.js:4:6296)
at napster.min.js:15
Napster.init({
consumerKey: 'ZTk2YjY4MjMtMDAzYy00MTg4LWE2MjYtZDIzNjJmMmM0YTdm',
isHTML5Compatible: true,
version: 'v2.1',
player: 'player-frame'
// player: "aside"
});
Napster.member.set({
accessToken: 'oauth access token',
refreshToken: 'oauth refresh token'
});
Napster.player.on('ready', function (e) {
Napster.member.set({ accessToken: 'oauth access token' }); // If not set earlier
Napster.player.auth();
});
Napster.player.play('tra.313617399');
Has this been deprecated by any chance?
When the Player tries to access https://app.napster.com/sdk/streaming-player-1.0.1.js
It is instead redirected to the web player and can no longer fetch https://app.napster.com/sdk/streaming-player-1.0.1.js
So, this code in napster.js at line 124 fails:
$.ajax({
url: 'https://app.napster.com/sdk/streaming-player-1.0.1.js',
dataType: 'script',
async: true,
success: function () {
Napster.player.fire('ready');
}
});
I was trying to test the sdk with my napster account I got on a different distributor, in this case ALDI. They have a different catalog, so defining the catalog in api requests seem to work properly. However, if I want to play a track (e.g. tra.55620987 on catalog DE_ALDI_BOLT) it returns "Error: No streams found".
I looked at the request and noticed that if I sent a request to the api with the catalog parameter it tells me that this track is streamable, but the request made by the streaming player does not add this parameter and returns that it is not streamable, even if I initialized the NapsterSDK with the catalog
Hi API team, thanks for the lovely interview today 👍
Just in case you forget, I ran into this issue last night when I made my developer account, got my oauth access tokens, and followed the docs running 'client.html' on a public domain.
Do public users have access to put Napster's player on any website?
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?
SDK cannot access the DRM player. Appears that API endpoints have changed.
When I run the basic_example, all the music info is loaded(authorized successfully). But when I try to play any song, I get the 403 (Forbidden) info: "User not allowed to stream"
I am getting the following exception in the developer console when running the example app:
Uncaught (in promise) DOMException
load (async)
n @ streaming-player.js?_=1555780103494:8
E @ streaming-player.js?_=1555780103494:7
b @ streaming-player.js?_=1555780103494:7
w @ streaming-player.js?_=1555780103494:10
Je @ streaming-player.js?_=1555780103494:10
Tn @ streaming-player.js?_=1555780103494:8
on @ streaming-player.js?_=1555780103494:8
e @ streaming-player.js?_=1555780103494:9
e @ streaming-player.js?_=1555780103494:9
e.setSource @ streaming-player.js?_=1555780103494:27
(anonymous) @ streaming-player.js?_=1555780103494:27
e @ streaming-player.js?_=1555780103494:27
e @ streaming-player.js?_=1555780103494:27
(anonymous) @ streaming-player.js?_=1555780103494:27
e @ streaming-player.js?_=1555780103494:27
e @ streaming-player.js?_=1555780103494:27
(anonymous) @ streaming-player.js?_=1555780103494:27
ii @ streaming-player.js?_=1555780103494:27
(anonymous) @ streaming-player.js?_=1555780103494:27
e @ streaming-player.js?_=1555780103494:34
ii @ streaming-player.js?_=1555780103494:27
ii @ streaming-player.js?_=1555780103494:27
(anonymous) @ streaming-player.js?_=1555780103494:27
e @ streaming-player.js?_=1555780103494:27
(anonymous) @ streaming-player.js?_=1555780103494:27
setTimeout (async)
e @ streaming-player.js?_=1555780103494:27
Kn @ streaming-player.js?_=1555780103494:27
e @ streaming-player.js?_=1555780103494:27
e @ streaming-player.js?_=1555780103494:10
(anonymous) @ streaming-player.js?_=1555780103494:10
Promise.then (async)
e @ streaming-player.js?_=1555780103494:10
e.play @ napster.min.js:formatted:152
(anonymous) @ client.html?accessTo…3a7-fd7989e1ff3a:80
dispatch @ jquery-1.11.0.min.js:3
r.handle @ jquery-1.11.0.min.js:3
While I am unable to reproduce it 100%, I notice it happening when I pause one song and start another one as fast as I can. This way, I can consistently and frequently reproduce.
I was following the readme file and kept hitting an error where the player object was null. While trying to get the example to run I saw that node.js was required. Possibly this could be inferred by reading the package.json file but I failed that lesson the fist time also. After placing the package.json file in the root of my project and running 'npm install' it worked. Might be nice to add this to the ReadMe.txt file.
Ed
I get playevent and metadata and error, but no playtimer. I'm revisiting code after a 2 year hiatus. playtimer events worked in September of 2015 with rhapsody.js. Any advice?
Able to play tracks (albeit intermittently, but seems to be different issue) on my local machine but always fails when I deploy to a test virtual machine (different network). I am using the password grant authentication scheme.
The error I get is:
streaming-player.js?_=1555903584712:27 VIDEOJS: ERROR: TypeError: Cannot read property 'attributes' of undefined
at e (streaming-player.js?_=1555903584712:34)
at r.<anonymous> (streaming-player.js?_=1555903584712:34)
at r.n.dispatcher (streaming-player.js?_=1555903584712:27)
at ye (streaming-player.js?_=1555903584712:27)
at r.Oe.trigger (streaming-player.js?_=1555903584712:27)
at streaming-player.js?_=1555903584712:34
I assume I am making an error with authentication because when I invoke Napster.member.set
with a bogus accessToken
I get the same errors.
Help is appreciated.
Hy guys,
trying to use your web example.
Firefox and Safari won't load anything (probably because they're blocking flash).
When using chrome, and manually allow flash, everything loads. When trying to play one music I have this "ResourceNotFound" error:
Just running the example provided with the apiKey and apiSecret changed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.