Home » Javascript » javascript – Soundmanager2, how to detect if autoplay disabled?

javascript – Soundmanager2, how to detect if autoplay disabled?

Posted by: admin February 23, 2020 Leave a comment

Questions:

Im trying to autoplay a radio station:

soundManager.setup({
    url: 'blahblah',
    debugMode: true,
    onready: function () {
        var mySound = soundManager.createSound({
            id: 'gggg',
            url: eeee
        });
        mySound.play();
    }
});

Chrome is saying:

Uncaught (in promise) DOMException: play() failed because the user didn’t interact with the document first. https://developers.google.com/web/updates/2017/09/autoplay-policy-changes

Firefox is saying:

NotAllowedError: The play method is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.

but how can I actually learn wheter its being player or not, beside the fact that I hear nothing?

How to&Answers: