1

我将 Flowplayer 用于客户的自定义 Intranet,并使用 CKEditor 添加页面内容。在 HTML 中无法访问网站的 HEAD),所以我一直在使用内联 CSS 语法。

客户端请求在单击播放之前在播放器区域中显示图像。我可以只使用内联 CSS 获得启动画面或海报吗?

<p>Here is a new sample video.</p>
<script src="http://releases.flowplayer.org/js/flowplayer-3.2.12.min.js"></script>

<div id="clip01" style="margin:0px auto; width:500px;height: 300px; text-align:center; background-image:url('http://31.media.tumblr.com/tumblr_lrqfj1ELAQ1qzi2ewo1_500.jpg');"></div>
<script>
   $f("clip01", "http://releases.flowplayer.org/swf/flowplayer-3.2.16.swf", {
      clip: {
         url: 'mp4:vod/demo.flowplayervod/bbb-800.mp4',
         scaling: 'fit',
         autoPlay: false,
         autoBuffering: true,
         provider: 'rtmp'
      },
      plugins: {
         rtmp: {
            url: "flowplayer.rtmp-3.2.12.swf",
            netConnectionUrl: 'rtmp://rtmp01.hddn.com/play'
        }
      },
      canvas: {
         backgroundGradient: 'none'
      }
   });
</script>    

到目前为止,我没有尝试过显示背景图片。播放器以黑色背景加载。

这是一个玩它的小提琴:http: //jsfiddle.net/GuVbJ/

4

3 回答 3

3

您需要做的就是在 flowplayer 中放置一个图像div。Flowplayer 然后将图像用作启动画面。当您单击图像时,将播放视频。

例子

<script src="http://releases.flowplayer.org/js/flowplayer-3.2.12.min.js"></script>

<div id="clip01" style="margin:0px auto; width:500px;height: 300px; text-align:center;">
    <img src="http://31.media.tumblr.com/tumblr_lrqfj1ELAQ1qzi2ewo1_500.jpg" alt="Bacon" />
</div>
<script>
    $f("clip01", "http://releases.flowplayer.org/swf/flowplayer-3.2.16.swf", {
      clip: {
          url: 'mp4:vod/demo.flowplayervod/bbb-800.mp4',
          scaling: 'fit',
          autoBuffering: true,
          provider: 'rtmp'
      },
      plugins: {
          rtmp: {
              url: "flowplayer.rtmp-3.2.12.swf",
              netConnectionUrl: 'rtmp://rtmp01.hddn.com/play'
          }
      },
      canvas: {
         backgroundGradient: 'none'
      }
   });
</script>   

jsFiddle

有关启动屏幕的更多详细信息,请参阅flowplayer 文档

于 2013-10-09T12:25:41.427 回答
0

只有 CSS 会很困难,你可以用 js 在它上面放置一个 div 并在播放时删除。

于 2013-10-08T21:10:50.310 回答
0

Flowplayer no longer offers a standalone player. Older versions are still available with a GPL v3 license, so here's a solution that doesn't rely on Flash:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flowplayer/7.2.4/skin/skin.css">
<style>
   body {
      font-family: verdana, tahoma, arial, sans-serif;
      font-size: 14px;
      margin: 0;
      padding: 0;
   }
   #content {
      margin: 50px auto;
      max-width: 500px;
   }
   #css-poster {
      background-image: url(https://31.media.tumblr.com/tumblr_lrqfj1ELAQ1qzi2ewo1_500.jpg);
      background-color: #000;
      background-size: 200%;
      -webkit-transition: background 1s .5s;
      -moz-transition: background 1s .5s;
      transition: background 1s .5s;
   }
   #css-poster.is-poster {
      background-size: 100%;
   }
</style>
<div id="content">
   <div id="css-poster" data-aspect-ratio="47:25" class="flowplayer no-volume">
      <video>
         <source type="video/webm" src="https://edge.flowplayer.org/black/470x250.webm">
         <source type="video/mp4"  src="http://p.demo.flowplayer.netdna-cdn.com/vod/demo.flowplayer/bbb-800.mp4">
      </video>
   </div>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/flowplayer/7.2.4/flowplayer.min.js"></script>

Here's the fiddle.

于 2020-12-31T11:57:18.280 回答