Created
November 23, 2013 09:16
-
-
Save yojeek/7612518 to your computer and use it in GitHub Desktop.
BigVideo.js fallback to image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BigVideo init | |
var BV = new $.BigVideo(), | |
vjsPlayer, fallback = false; | |
BV.init(); | |
vjsPlayer = BV.getPlayer(); | |
vjsPlayer.on('error', function() { | |
if (!fallback) { | |
// trying to apply fallback | |
fallback = true; | |
BV.show('/workspace/assets/vids/bigvideo-fallback.jpg', {ambient: true}); | |
} | |
}) | |
vjsPlayer.on('loadeddata', function(){ | |
$("#big-video-vid").css('visibility', 'visible'); | |
}) | |
$("#big-video-vid").css('visibility', 'hidden'); | |
BV.show('/workspace/assets/vids/kids.mp4', {ambient: true}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment