Vide icon indicating copy to clipboard operation
Vide copied to clipboard

Onload callback?

Open JeromeDeBoysere opened this issue 10 years ago • 4 comments

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

JeromeDeBoysere avatar Nov 18 '15 12:11 JeromeDeBoysere

Hi, did you find any solution for that? I need a callback like videoEnded: function(){} or something like that.

Hizbullah avatar Jan 25 '16 19:01 Hizbullah

Nop, sorry...

JeromeDeBoysere avatar Jan 26 '16 12:01 JeromeDeBoysere

There is getVideoObject method: https://github.com/VodkaBears/Vide#methods There is HTMLVideoElement documentation: https://developer.mozilla.org/en/docs/Web/API/HTMLVideoElement

vodkabears avatar Jan 26 '16 18:01 vodkabears

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

toovy avatar Jun 22 '16 10:06 toovy