Ajmal Afif's blog

Balancing between consuming knowledge and creating values.

BigVideo.js: Show fullscreen poster image with BackStretch.js when video ended

Resources

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$(function() {
    var BV = new $.BigVideo();
    BV.init();
if (Modernizr.touch) {
    BV.show('[image-link]');
} else {
    BV.show('[video-link]', {ambient:true});
    _V_("#big-video-vid_html5_api" || "#big-video-vid_flash_api").ready(function(){
       this.addEvent("ended", function(){
          //show poster image
          $('#big-video-vid_html5_api' || '#big-video-vid_flash_api').css('display','none');
          $('.home').backstretch("[image-link]", {target: 'div.intro', positionType: 'absolute'});
       });
    });
}
});

Replace [image-link] and [video-link] with correct URLs.

Comments