Flowplayer控件:autoHide和autoPlay

时间:2011-11-16 19:29:42

标签: animation flowplayer autostart

我无法让我的播放器自动启动或控件自动隐藏。我相信我已经正确设置了它,但它只是不起作用。这是我的整个脚本标记:

<script type="text/javascript">
    // wait for the DOM to load using jQuery
    $(function() {

        // setup player normally
        $f("videoPlayer", "videos/flowplayer-3.2.7.swf", {

            // clip properties common to all playlist entries
            clip: {
                autoPlay: false,
                autoBuffering: true,
                baseUrl: 'http://thepartysource.com/videos/',
                subTitle: '',
                time: '' 
            },

            // our playlist
            playlist: [
                {
                    url: 'DRINK DIFFERENTLY - 480x272.m4v',
                    autoPlay: true
                },
                {
                    url: 'DRINK DIFFERENTLY - 480x272.m4v'
                }
            ],

            // show playlist buttons in controlbar
            plugins: {
                controls: {
                    playlist: true,

                    // display properties such as size, location and opacity
                    top: 20,
                    left: 0,
                    bottom: 0,
                    opacity: 0.95,

                    // styling properties (will be applied to all plugins)
                    background: '#000', // url(/my/custom/controls.png) no-repeat 3px 6px',
                    backgroundGradient: 'low',

                    // controlbar specific settings
                    timeColor: '#980118',
                    all: false,
                    play: false,
                    scrubber: true,
                    fullscreen: true,

                    // tooltips (since 3.1)
                    tooltips: {
                        buttons: false,
                        //fullscreen: 'Enter fullscreen mode'
                    },

                    autoHide: {
                        enabled: true,

                        // always enable
                        fullsccreenOnly: false,

                        // make it hide faster
                        hideDelay: 1000,

                        mouseOutDelay: 500
                    }
                }
            }
        });

        /*
            here comes the magic plugin. It uses first div.clips element as the 
            root for as playlist entries. loop parameter makes clips play
            from the beginning to the end.
        */
        $f("videoPlayer").playlist("div.clips:first", {loop:true});
    });

</script>

以下是HTML区域:

<div class="box-movie">
    <!-- the player using splash image -->
    <a class="player plain" id="videoPlayer">
        <img src="images/play_text_large.png" />
    </a>

    <div class="clips" style="margin-top:15px;">
        <!-- single playlist entry as an "template" -->
        <a href="${url}">&nbsp;
            <!--${title}--> <!--<span>${subTitle}</span>-->
            <!--<em>${time}</em>-->
        </a>
    </div>

    <!-- let rest of the page float normally -->
    <br clear="all"/>
</div>

修改

我实际上发现了问题所在。当它加载时,它几乎只是一个启动图像,而不是实际的播放器。您可以在http://thepartysource.com/index_test.php查看此信息。如果我将第二个剪辑设置为自动播放,则在第一个剪辑完成后会这样做。

1 个答案:

答案 0 :(得分:0)

我必须将div.clips标记更改为:

<!-- the player using splash image -->
<a href="videos/flowplayer-3.2.7.swf" class="player plain" id="videoPlayer">
</a>

指定要开始的流动播放器的href。这让玩家加载页面加载,并且autoPlay开始工作。