Skip to content

Playing Audio #1

@alvarofernandezavalos

Description

@alvarofernandezavalos

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions