【发布时间】:2011-05-02 09:24:22
【问题描述】:
我正在使用 MediaElement.js 创建一个音频播放器,如下所示:
//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);
}
});
错误回调被立即调用,但它只包含媒体元素作为参数。这并不能告诉我出了什么问题。
如何获取实际的错误消息以便调试此问题?
请注意,我只使用 MediaElement 核心 API,因此不是实际的播放器(所以我只包含 mediaelement.js)。
【问题讨论】:
标签: javascript html mediaelement.js