View:
<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>
Controlller:
$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';
};
I call this function getIdVideo()
to return a video according to the id passed as argument, the problem is that for each id I need to show 4 videos
varying from 2 to 5, the number that comes after the "_" of the url below:
"http: /cdn.leagueoflegends.com/champion-abilities/videos/mp4/ '+ videoId +' _ 02.mp4"
I thought about using make the function return the 4 url's and then use ng-repeat
to display the 4 different videos, but I could not implement this. How can I solve my problem?