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

RequireJS - Error: a.default is not a function #2918

Open
amir-prince opened this issue Feb 14, 2023 · 0 comments
Open

RequireJS - Error: a.default is not a function #2918

amir-prince opened this issue Feb 14, 2023 · 0 comments

Comments

@amir-prince
Copy link

Hi,

Someone has already implemented mediaelement via RequireJS? I encounter the following error: Uncaught TypeError: a.default is not a function

RequireJS config :

requirejs.config({
    paths: {
        jQuery: 'https://code.jquery.com/jquery-3.6.3.min',
        mediaElement: 'https://cdnjs.cloudflare.com/ajax/libs/mediaelement/6.0.1/mediaelement-and-player.min'
    },
    shim: {
        "mediaElement": {
            deps: ["jquery"]
        }
    }
});

require(['jQuery','mediaElement'], function($, MediaElementPlayer) {
    'use strict';
    var player = new MediaElementPlayer('player-audio', {
        //player configuration here...
    });

JsFiddle example.

Thanks

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

1 participant