Open dorthrithil opened 6 years ago
Hi. I am a bit bussy right now with my other projects but if you want i can do it for you as a small freelance task. If you interested please write to: vvvmax@gmail.com
On Tue, Aug 7, 2018, 11:54 AM Felix Engelmann notifications@github.com wrote:
I need to detect video events (play, pause, ended, ...) in my application. As far as I can see from the documentation those events are not forwarded by the api.
Right now I use the following workaround which is necessary as video elements are dynamically inserted by the gallery when you press play:
this.mutationObserver = new MutationObserver((mutations: any) => { mutations.forEach(mutation => { mutation.addedNodes.forEach(addedNode => { if (addedNode.nodeName === 'VIDEO') { $(addedNode).on('play', () => { // Do something }); // Watch more events } }); }); }); this.mutationObserver.observe(document.body, {childList: true, subtree: true});
This solution works fine, but I think it would be better if you forward the media events via the unitegallery API.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vvvmax/unitegallery/issues/193, or mute the thread https://github.com/notifications/unsubscribe-auth/AC_K_kfvyNg5bNwI5-ofKDjvnGmYL7vrks5uOVWvgaJpZM4VxwGj .
I need to detect video events (
play
,pause
,ended
, ...) in my application. As far as I can see from the documentation those events are not forwarded by the api.Right now I use the following workaround which is necessary as video elements are dynamically inserted by the gallery when you press play:
This solution works fine, but I think it would be better if you forward the media events via the unitegallery API.