使用ng-repeat angularjs videojs显示vimeo视频

时间:2016-02-24 12:37:27

标签: javascript angularjs angularjs-ng-repeat vimeo video.js

我试图用angularjs显示视频 这是我的代码:

<span class="video-inner" ng-repeat="item in items">
    <video id="video-{{item.id}}"
        class="video-js vjs-default-skin"
        controls
        preload="auto"
        width="600"
        height="200"
        data-setup='{
            "techOrder": ["vimeo"],
            "sources": [
                { "type": "video/vimeo", "src": {{item.video}} }
            ]
        }'>
    </video>
</span>

数据:

   $scope.items = [
       {id: 1, video: "https://vimeo.com/63186969"},
       {id: 2, video: "https://vimeo.com/63186969"}
   ];

这是我使用的示例: https://static.bini.io/cus-videos/ 但它不起作用 我错过了什么?

1 个答案:

答案 0 :(得分:0)

我不认为,您需要使用{{}}

进行插值
 <video id="video-item.id"
        class="video-js vjs-default-skin"
        controls
        preload="auto"
        width="600"
        height="200"
        data-setup='{
            "techOrder": ["vimeo"],
            "sources": [{ "type": "video/vimeo",
            "src": item.video}]
            }'>
 </video>