Onload callback?
Hi,
Is it possible to add a callback function called when the video is loaded ? In my case, I would like to "fade in" my video with a CSS classe when it is ready to play.
This could be a new option like this one:
{ videoLoaded : function() { }, // fired when the video is loaded (or when the placeholder .jpg is loaded [if video is not supported]) }
In this way, your could easily add new options like:
{ videoLoaded : function() { }, // fired when the video is loaded videoStarted: function() { }, // fired when the video starts videoEnded: function() { } // ... }
edit
My request is similar to https://github.com/VodkaBears/Vide/issues/130
Hi, did you find any solution for that? I need a callback like videoEnded: function(){} or something like that.
Nop, sorry...
There is getVideoObject method: https://github.com/VodkaBears/Vide#methods
There is HTMLVideoElement documentation: https://developer.mozilla.org/en/docs/Web/API/HTMLVideoElement
Had the requirement to fade the video in. This way you can fetch the raw HTML5 video event:
# pseudo-coffeescript
$('#your-video').vide(...)
instance = $('#your-video').data('vide')
video = instance.getVideoObject()
video.onloadeddata = ->
# do what you like