Vimeo视频无法使用HTML5标记

时间:2013-08-25 06:34:58

标签: jquery html5 video slider vimeo

我想在Vimeo视频中添加一个滑块。我查看了this slider,但它使用了HTML5视频代码。当我使用与Vimeo视频网址相同的标签时,它无法正常工作。这是我的代码:

<video src="http://player.vimeo.com/video/68866759"></video>

以下是完整代码:

<html>
<body>
<script type='text/javascript' src='http://amazingslider.com/wp-includes/js/jquery/jquery.js?ver=1.7.2'></script>
<script type='text/javascript' src='http://amazingslider.com/wp-content/plugins/amazingslider-plugin/sharedengine/amazingslider.js?ver=1.6'></script>
<link rel="stylesheet" type="text/css" media="all" href="http://amazingslider.com/wp-content/themes/twentyeleven/style.css" />
<div class="demo-slider">
    <div style="display:block;position:relative;margin:15px auto 30px;" id="amazingslider-11">
        <ul style="display:none;" class="amazingslider-slides">
            <li><img alt="Big Buck Bunny Copyright  Blender Foundation" src="http://amazingslider.com/wp-content/uploads/amazingslider/11/images/big_buck_bunny_480_270.jpg">
                <video src="http://player.vimeo.com/video/68866759" preload="none"></video>
            </li>
            <li><img alt="Elephants Dream Copyright  Blender Foundation" src="http://amazingslider.com/wp-content/uploads/amazingslider/11/images/elephants_dream_480_270.jpg">
                <video src="http://www.youtube.com/embed/TLkA0RELQ1g" preload="none"></video>
            </li>
            <li><img alt="Sintel - Third Open Movie by Blender Foundation" src="http://amazingslider.com/wp-content/uploads/amazingslider/11/images/Sintel_480_270.jpg">
                <video src="http://www.youtube.com/embed/eRsGyueVLvQ" preload="none"></video>
            </li>
        </ul>
        <ul style="display:none;" class="amazingslider-thumbnails">
            <li><img src="http://amazingslider.com/wp-content/uploads/amazingslider/11/images/thumbnails/big_buck_bunny_480_270.jpg"></li>
            <li><img src="http://amazingslider.com/wp-content/uploads/amazingslider/11/images/thumbnails/elephants_dream_480_270.jpg"></li>
            <li><img src="http://amazingslider.com/wp-content/uploads/amazingslider/11/images/thumbnails/Sintel_480_270.jpg"></li>
        </ul>
        <div style="display:none;" class="amazingslider-engine"><a href="http://www.amazingslider.com">jQuery Slider</a></div>
    </div>
    <script src="http://amazingslider.com/wp-content/uploads/amazingslider/11/sliderengine/initslider.js"></script>
</div>
</body>
</html>

2 个答案:

答案 0 :(得分:20)

转到视频设置视频文件,底部有一个名为使用您自己的播放器的部分,您会发现有直接网址到您的视频。例如:

<video src="http://player.vimeo.com/external/85569724.sd.mp4?s=43df5df0d733011263687d20a47557e4"></video>

注意:这需要 PRO Vimeo帐户。

答案 1 :(得分:-1)

您需要使用我们的嵌入代码才能正常工作。 http://player.vimeo.com/video/68866759不是视频文件,而是HTML页面,因此将其放入视频代码中将无法执行任何操作。

如果用这个替换视频标签,它应该可以工作:

<iframe src="//player.vimeo.com/video/68866759" width="960" height="540" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>