MediaElement.js - getting debugging information

I am creating an audio player with MediaElement.js, for example:

//button has been clicked, create new audio player and play
var audioElement = $('<audio>', {
    id : 'audioPlayer' + index,
    src : '/streamFriendFile',
    loop : 'loop',
    preload : 'none'
})[0];
$(row).append(audioElement);
new MediaElement(audioElement, {
    plugins : ['flash', 'silverlight'],
    pluginPath : 'http://localhost:3000/mediaelement/',
    flashName : 'flashmediaelement.swf',
    silverlightName : 'silverlightmediaelement.xap',
    pluginWidth : 0,
    pluginHeight : 0,
    audioWidth: 0,
    audioHeight : 0,
    startVolume: 0.8,
    //loop: true,
    //enableAutosize: false,
    //features : [],
    //timerRate : 250,
    success : function(mediaElement, domObj) {
        console.log('mediaElement success!');
        mediaElement.play();
    },
    error : function(mediaElement) {
        console.log('medialement problem is detected: %o', mediaElement);
    }
});

The error callback is immediately called, but it contains only the media element as an argument. This does not tell me what is wrong.

How can I get the actual error message so that I can debug this problem?

Please note that I only use the MediaElement API and not the actual player (therefore I only include mediaelement.js).

+3
source share
1 answer

In the MediaElement parameters (along with flashName, silverlightName, etc.) add enablePluginDebug:true, and debugging errors should appear on the screen. From the API link in the sample code on the right.

, , - , github repo. "", ( , 2.2).

, , , .

+3

All Articles