如何使mediaelement.js提示下载Flash



如果mediaelement.js无法加载Flash插件,它只显示"下载文件"。如何让它显示下载Flash插件的提示?

当Flash不可用时,是否会引发一些事件?

当您指定媒体元素选项时,您可以通过向customError属性提供html片段来覆盖在没有插件可用时显示的内容。

这里有一个例子:

$('#player').mediaelementplayer({
            customError:'Please install <a href="http://get.adobe.com/flashplayer" target="_blank">Flash Player</a> to listen to this file'
        });

如果你使用默认的皮肤,文本可能是黑色的,所以你会想包括一些东西,比如:

<style>
        .me-cannotplay {
            color: white;
            font-size: 80%;
            margin: 5px;
        }
</style>

最新更新