Code:
router.get('/', function(req, res) {
const SC = require('soundcloud-v2-api');
SC.init({
clientId: 'myIdOfSoundCloud',
cors: true
})
// WORKS
//SC.get('/search/tracks', {
//q: 'Post', limit: 1
//}).then(result => console.log(result))
SC.stream('/tracks/341546259/streams').then(stream => {
stream.play()
})
res.render('soundcloud', {title: 'LAPI-[ZERO]',text: 'Welcome'});
});
Exception
(node:45533) UnhandledPromiseRejectionWarning: ReferenceError: Audio is not defined
at axios.then.res (/home/afernandez/nodejs/lapi0/node_modules/soundcloud-v2-api/index.js:39:23)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:45533) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:45533) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Code:
router.get('/', function(req, res) {
const SC = require('soundcloud-v2-api');
});
Exception
(node:45533) UnhandledPromiseRejectionWarning: ReferenceError: Audio is not defined
at axios.then.res (/home/afernandez/nodejs/lapi0/node_modules/soundcloud-v2-api/index.js:39:23)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:45533) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:45533) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.