Skip to content

Error "Uncaught TypeError: Cannot read property 'play' of undefined" #85

@tobilg

Description

@tobilg

When using the ngAudio.play() method with a remote resource, I receive the above error on my console (version is 1.7.0 on the latest Chrome).

It fails at audio.play();, what leads me to the assumption that audio has not yet been initialized upon calling.

if (ngAudioGlobals.unlock) {

            window.addEventListener("click",function twiddle(){
                audio.play();
                audio.pause();
                window.removeEventListener("click",twiddle);
            });

        }
}

Furthermore, I think I'm unable to set ngAudio.unlock = false as outlined at http://danielstern.github.io/ngAudio/#/docs

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