【问题标题】:Jplayer video with mp4 doesn't work with flash fallback in Opera / FF / IE带有 mp4 的 Jplayer 视频不适用于 Opera / FF / IE 中的 Flash 回退
【发布时间】:2023-04-06 00:07:01
【问题描述】:

我的网站上的视频存在这个问题,您可以在此链接中看到: http://video.resursecrestine.ro/predici/103445/nastere-din-nou-credinta-dragoste-in-aceasta-ordine

它在 Chrome 中运行良好,但在任何其他浏览器中都没有。我知道 Chrome 对 mp4 具有原生 HTML5 支持,但其他浏览器应该回退到 flash 而他们没有。

下面是我正在使用的代码:

<script type="text/javascript">
    //<![CDATA[
    $(document).ready(function(){

        $("#jquery_jplayer_1").jPlayer({
            ready: function () {
                $(this).jPlayer("setMedia", {
                    m4v: "http://www.resursecrestine.ro/download/41293"
                });
            },
            swfPath: "js",
            supplied: "m4v",
            size: {
                width: "580px",
                height: "360px",
                cssClass: "jp-video-360p"
            }
        });
    });
    //]]>
</script>
<div id="jp_container_1" class="jp-video jp-video-360p">
    <div class="jp-type-single">
        <div id="jquery_jplayer_1" class="jp-jplayer"></div>
        <div class="jp-gui">
            <div class="jp-video-play">
                <a href="javascript:;" class="jp-video-play-icon" tabindex="1">play</a>
            </div>
            <div class="jp-interface">
                <div class="jp-progress">
                    <div class="jp-seek-bar">
                        <div class="jp-play-bar"></div>
                    </div>
                </div>
                <div class="jp-current-time"></div>
                <div class="jp-duration"></div>
                <div class="jp-controls-holder">
                    <ul class="jp-controls">
                        <li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
                        <li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
                        <li><a href="javascript:;" class="jp-stop" tabindex="1">stop</a></li>
                        <li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a></li>
                        <li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li>
                        <li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume">max volume</a></li>
                    </ul>
                    <div class="jp-volume-bar">
                        <div class="jp-volume-bar-value"></div>
                    </div>
                    <ul class="jp-toggles">
                        <li><a href="javascript:;" class="jp-full-screen" tabindex="1" title="full screen">full screen</a></li>
                        <li><a href="javascript:;" class="jp-restore-screen" tabindex="1" title="restore screen">restore screen</a></li>
                        <li><a href="javascript:;" class="jp-repeat" tabindex="1" title="repeat">repeat</a></li>
                        <li><a href="javascript:;" class="jp-repeat-off" tabindex="1" title="repeat off">repeat off</a></li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="jp-no-solution">
            <span>Update Required</span>
            To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.
        </div>
    </div>
</div>

你能建议吗?

【问题讨论】:

    标签: html flash video jplayer


    【解决方案1】:

    看起来您的服务器正在发送带有text/plain MIME 类型的视频,而不是video/mp4。根据jPlayer Developer Guide 的说法,这是导致仅影响 Firefox 和 Opera 的问题的常见原因。

    【讨论】:

    • AddType video/mp4 mp4 AddType video/ogg ogv AddType video/webm webm
    • 在您提供的链接 (78.46.49.44) 中流式传输视频的 (nginx) 服务器仍在发送 text/html(以及格式错误的 Content-Disposition: : attachment; 标头),尽管看起来视频正在播放现在正确,所以我想 MIME 不是你的问题。
    【解决方案2】:

    我在使用 flash 解决方案时也遇到过类似的问题。确保您的元数据位于视频的开头。为此,您可以使用这个免费工具:

    http://rndware.info/products/metadata-mover.html

    【讨论】:

    • 问题是flash解决方案甚至没有启动,它仍然使用HTML解决方案,只有音频被解码,视频保持空白。还有其他想法吗?
    猜你喜欢
    • 1970-01-01
    • 2012-12-22
    • 1970-01-01
    • 2013-11-08
    • 2014-01-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多