刚开始使用jwplayer,我有几个问题

时间:2013-06-24 20:16:41

标签: javascript video-streaming jwplayer

我刚刚开始使用jwplayer,我有几个问题:

  1. 如何在标题旁边附加/显示缩略图(类似于youtube)?我是否必须自己创建缩略图或者jwplayer是否为我做了这个?

  2. 播放列表部分看起来很单调,只显示标题。如何显示视频的其他信息?即时间,作者/上传者等。

  3. 如果有文件,请指出我,到目前为止我还没找到。

    我目前的代码:

    <script type="text/javascript">
        jwplayer("myElement").setup({
            playlist: [{
                file: "/common/assets/sample_iPod.m4v",
                title: "Sample Video 1"
            },{
                file: "/common/assets/Wildlife_512kb.mp4",
                title: "Animals being CUTE!!!"
            },{
                file: "https://s3.amazonaws.com/asteroid.static.www.otcmarkets.com/videos_presentations/OTCM/Wildlife_512kb.mp4",
                title: "video from S3"
            },{
                file: "https://s3.amazonaws.com/asteroid.static.www.otcmarkets.com/videos_presentations/OTCM/sample_iPod.m4v",
                title: "ipod help from S3"
            }],
            width: 770,
            height: 360,
            listbar: {
                position: 'right',
                size: 240
            }
        });
    </script>
    

    enter image description here

1 个答案:

答案 0 :(得分:1)

要执行这些操作,您需要为每个播放列表条目添加图像和说明。

参考 - http://www.longtailvideo.com/support/jw-player/29249/playlist-sidebar-component

使用的代码:

<div id="myElement"></div>

<script>
    jwplayer("myElement").setup({
      playlist: [{
        file: "/uploads/sintel.mp4",
        image: "/uploads/sintel.jpg",
        title: "Sintel Trailer",
        description: "Sintel is a fantasy CGI movie from the Blender Open Movie Project."
      },{
        file: "/uploads/tears.mp4",
        image: "/uploads/tears.jpg",
        title: "Tears of Steel Trailer",
        description: "A complete open pipeline was used to produce this visual effect film."
      },{
        file: "/uploads/bunny.mp4",
        image: "/uploads/bunny.jpg",
        title: "Big Buck Bunny Trailer",
        description: "This  animated film is made using free and open source software."
      },{
        file: "/uploads/elephants.mp4",
        image: "/uploads/elephants.jpg",
        title: "Elephants Dream Trailer",
        description: "This is the worlds first open movie, made entirely with Blender."
      }],
      width: 700,
      height: 240,
      listbar: {
        position: "right",
        size: 280
      }
    });
</script>