ngAudio icon indicating copy to clipboard operation
ngAudio copied to clipboard

ReferenceError: Can't find variable: Audio

Open hannupekka opened this issue 12 years ago • 3 comments

grunt test gives the following error:

        ReferenceError: Can't find variable: Audio
            at /bower_components/ngAudio/app/angular.audio.js:44
            at /bower_components/ngAudio/app/angular.audio.js:72
            at /bower_components/angular/angular.js:11581
            at /bower_components/angular/angular.js:11714
            at /bower_components/angular/angular.js:12701
            at /bower_components/angular/angular.js:12513
            at /bower_components/angular/angular.js:12739
            at /bower_components/angular-mocks/angular-mocks.js:126
            at /bower_components/angular-mocks/angular-mocks.js:1644
            at /test/spec/controllers/ctrl.js:65

This is caused having $scope.sound= ngAudio.load('sounds/sound.mp3'); in my controller. Audio works perfect but karma tests with jasmine & phantomjs fails.

hannupekka avatar Sep 10 '14 08:09 hannupekka

Audio is a native HTML5 element. You need to configure your Phantom.js or whatever browser you are using to shim it.

danielstern avatar Sep 10 '14 12:09 danielstern

@danielstern, how to config, can you show me a demo? thanks!

10W8K avatar Sep 21 '17 09:09 10W8K

Hello, did you find any solution for the above error? Thank u!

goodstas avatar Jan 19 '18 21:01 goodstas