I load quite a few videos on the page, from youtube. I want to replace the div with placeholder, and only request the video when user clicks on the placeholder image.
I got this part working where it loads the video on ng-click, but it loads all of them, obviously. How do I load just the one that was clicked?
Here's my html inside ng-view and ng-repeat:
<figure class=" img-responsive">
<iframe width="320" height="180" ng-src="{{item.VideoUrl | trusted }}"
frameborder="0" allowfullscreen="false" autoplay="0" ng-if="doplay">
</iframe>
<img ng-src="images/logos/videoplaceholder.jpeg" height="180"
class="img-responsive" ng-if="!doplay" ng-click="setPlay()" />
</figure>
<script>
$scope.setPlay = function (){
$scope.doplay = true;
}
</script>
Like I said, the above works, but loads all the videos at once. I need to load just the one that was clicked. Thanks!!