javascript - Return multiple videos to poster photo -
i have got website on 20 videos , use video.js plugin play them. have come problem - want each video returned it's poster photo after it's finished.
i've got code:
<script> var video = videojs('#myvideo'); video.on('ended', function() { video.trigger('loadstart'); video.posterimage.show(); }); </script>
everything ok until put there more 1 video, because code refers 1 of them id="myvideo". there way overwrite code more general or have use loop , make function each video on website?
thanks replies
this simpler in css
.video-js.vjs-ended .vjs-poster { display: block; }
Comments
Post a Comment