mediaelement.js: Local Flash playback shows black video with sound unless shown full screen

末鹿安然 提交于 2019-12-21 22:33:03

问题


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:


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);
    }
});


来源:https://stackoverflow.com/questions/9182682/mediaelement-js-local-flash-playback-shows-black-video-with-sound-unless-shown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!