Jplayer无法在Chrome中使用

时间:2014-04-21 13:52:00

标签: jquery html google-chrome

我有以下代码,我想在我的网站上播放视频,Jplayer在Firefox中工作得很好..但是在Google Chrome中不起作用,我放置了Jplayer的div没有显示在chrome中。谢谢你的帮助

                                             

    <script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>

    <script src="js/html5.js" type="text/javascript"></script>
    <script src="js/functions.js" type="text/javascript"></script>

    <script src="jquery.jplayer.min.js" type="text/javascript"></script>
     <script>
    $(Document).ready(function(){
            $("#jquery_jplayer_1").jPlayer({
                ready: function () {
                    $(this).jPlayer("setMedia", {
                        m4v: "http://www.jplayer.org/video/m4v/Big_Buck_Bunny_Trailer.m4v",
                        ogv: "http://www.jplayer.org/video/ogv/Big_Buck_Bunny_Trailer.ogv",
                        webmv: "http://www.jplayer.org/video/webm/Big_Buck_Bunny_Trailer.webm",
                        poster: "http://www.jplayer.org/video/poster/Big_Buck_Bunny_Trailer_480x270.png"
                    });
                },
                swfPath: "jQuery.jPlayer.2.5.0/js",
                supplied: "webmv, ogv, m4v",
                size: {
                    width: "850px",
                    height: "478px",
                    cssClass: "jp-video-360p"
                },

               // smoothPlayBar: true,
               // keyEnabled: true
            });
            $("#jquery_jplayer_1").click(function(){            
                $("#jquery_jplayer_1").jPlayer("play");
                endpartVideo();
            });


    });
        function endpartVideo() {
                $('#jquery_jplayer_1').bind($.jPlayer.event.timeupdate, function (event) {
                    var current = $.jPlayer.convertTime($('#jquery_jplayer_1').data('jPlayer').status.currentTime);
                    var duration = $.jPlayer.convertTime($('#jquery_jplayer_1').data('jPlayer').status.duration);

                    if (current == duration) {
                        alert("video end");


                    }
                });
            }
  </script>

</head>
<body>
    <!-- Shell -->
    <div class="shell">
        <!-- HEader -->
        <header>
            <!-- Logo -->
            <h1 id="logo"><a href="#" title="home">SiteName<span>.com</span></a></h1>
        </header>   
        <!-- END Header -->
        <!-- content -->
        <section id="content">
            <!-- Video Holder -->
            <section class="video-holder">
             <div id="jquery_jplayer_1" class="jp-jplayer"></div>
                <!-- <iframe width="850" height="478" src="<iframe src="//player.vimeo.com/video/92019619" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> <p><a href="http://vimeo.com/92019619">Team Synergy One - Wake Up Now - Opportunity</a> from <a href="http://vimeo.com/user26967867">Rockey Heath</a> on <a href="https://vimeo.com">Vimeo</a>.</p>" frameborder="0" allowfullscreen></iframe> -->
            </section>
            <!-- END Video Holder -->
            <!-- Form Wrap -->
            <section class="box" data-seconds="8" data-minutes="0">
                <form action="#" method="post">
                    <input type="submit" value="Click Here To Contact Us" class="submit-button" />
                </form>
                <p class="banners"></p>
            </section>  
            <!-- END Form Wrap -->
        </section>  
        <!-- END content -->
    </div>
    <!-- END Shell -->
</body>
</html>

以下是控制台上的错误

Uncaught TypeError: Illegal constructor

1 个答案:

答案 0 :(得分:0)

将此功能$(Document).ready(function(){更改为$(document).ready(function(){ ..它可以正常工作