Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If URL doesn't have .mp3 console will throw error #12

Open
kyoukhana opened this issue Jul 6, 2020 · 8 comments
Open

If URL doesn't have .mp3 console will throw error #12

kyoukhana opened this issue Jul 6, 2020 · 8 comments

Comments

@kyoukhana
Copy link

Lets say your loading tracks that require AUTH like this

/api/user/track/audio/9?token=eyJ0eXAiOi

The api returns the mp3 file

Here is the error I get in the console

All audio resources are loaded 19.app.js:1:1825
Object { url: "http://localhost:8080/api/user/track/audio/9?token=eyJ0eXAiO…YzI2MzkwNTg3NCJ9.FR0Ofig8p2JdHd0ukb_1gyyaS2gNdDTqGSgM1WhbyWg", value: AudioBuffer, error: null, status: "success" }
19.app.js:1:1871
Uncaught TypeError: e is undefined
    value http://localhost:8080/js/19.app.js:10
    value http://localhost:8080/js/19.app.js:10
    value http://localhost:8080/js/19.app.js:10
    value http://localhost:8080/js/19.app.js:10
    play http://localhost:8080/js/19.app.js:1
    n http://localhost:8080/js/app.js?ver=zdxr5612&a=1:23
    t http://localhost:8080/js/app.js?ver=zdxr5612&a=1:23
@vanand-conga
Copy link
Contributor

Can you please try specifying format.

$buzz.play({
    src: '/api/user/track/audio/9?token=eyJ0eXAiOi',
    format: 'mp3'
});

@kyoukhana
Copy link
Author

That worked but when doing a promise throws a error still

  $buzz.setup(); // you need to call setup before doing anything in global level.

                var promise = $buzz.load('/api/user/track/audio/9?token='+this.$auth.token());

                promise.then(function(evt) {
                    console.log('All audio resources are loaded');
                    console.log(evt);
                });


                var buzz1 = $buzz({
                    src: '/api/user/track/audio/9?token=eyJ0eXAiOi,
                    format: 'mp3'
                });

                buzz1.play();

@vanand-conga
Copy link
Contributor

Will reply you in couple of days.

@kyoukhana
Copy link
Author

Sure thanks for help.

@vanand-conga
Copy link
Contributor

This needs little more work than I thought. I need to change the method so we can pass the format also. Will be available by this week.

@kyoukhana
Copy link
Author

That is cool. Just take your time ok :) . I have really started working with the library so you might get questions from time too time.

@vanand-conga
Copy link
Contributor

Is it possible to send some sample code to reproduce this error locally? or is there is any other option?

@kyoukhana
Copy link
Author

the problem is in this code part

 $buzz.setup(); // you need to call setup before doing anything in global level.

                var promise = $buzz.load('/api/user/track/audio/9?token='+this.$auth.token());

                promise.then(function(evt) {
                    console.log('All audio resources are loaded');
                    console.log(evt);
                });

problem looking for .mp3 will throw a error

'/api/user/track/audio/9?token='+this.$auth.token()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants