mediaelement.js: Local Flash playback shows black

2019-04-13 11:22发布

When using mediaelement.js for playback from a webserver, everything works as it should.

If I try running from my local hard disk, in HTML 5 the video plays fine, however, when the flash player is used the audio plays but the video is black. If I select full screen, the video plays.

This occurs even with the Demo players that are included as part of the download.

Does anyone know if there is a fix for this?

1条回答
做个烂人
2楼-- · 2019-04-13 12:02

After some experimenting I was able to resolve my own question.

I added an explicit call to setVideoSize with the correct dimensions and now the video displays when run from the local drive as well as from a web server.

Example:

$('video').mediaelementplayer({
    enableAutosize: true,
    success: function(player, node) {
        player.setVideoSize(480,320);
    }
});
查看更多
登录 后发表回答