查看:
<div class="list card" ng-repeat="x in content.spells">
....
<video width="320" height="240" ng-src="{{(getIdVideo(content.id) | trusted )}}" controls>
Seu navegador não suporta o elemento <code>video</code>.
</video>
....
</div>
控制器:
$scope.getIdVideo = function(videoId){
videoId = videoId.toString();
for (var i=0; i<=4; i++){
if (videoId.length != 4){
//videoId = videoId.push('0');
videoId = "0"+videoId;
}
}
return 'http://cdn.leagueoflegends.com/champion-abilities/videos/mp4/'+videoId+'_02.mp4';
};
我调用此函数getIdVideo()
,根据id
返回视频。我的方式显示相同的视频4次。问题是,我需要向每个id
显示4个视频,只需更改,从02到05,&#34; _&#34;在网址:
HTTP:/cdn.leagueoflegends.com/champion-abilities/videos/mp4 /&#39 + + VIDEOID&#39; _02.mp4
我该怎么做?
答案 0 :(得分:1)
从外观上看,id
似乎是内容。但您需要在id
上设置content.spells
。
然后你可以使用
<video width="320" height="240" ng-src="{{(getIdVideo(x.id) | trusted )}}" controls>