-
AuthorPosts
-
December 13, 2016 at 5:42 pm #723872
is it possible to autoclose the lightbox when video stops at the end?
Thanks
December 16, 2016 at 2:53 pm #725340Hey Guenter,
wouldn’t be very easy as far as I know and I bet you would know the solution if it would be possible :).
Best regards,
AndyDecember 16, 2016 at 4:50 pm #725437well there is inside the iframe a class added after video play. ended-mode
but i don’t know how to close the parent div (maybe : div.mfp-container ) if the class exists.i look into youtube video player api there are eventlisteners which might help
i think it will be nice to give a unique ID to that video
- This reply was modified 7 years, 11 months ago by Guenni007.
December 17, 2016 at 5:00 pm #725721on shortcodes.js from line 900 you have :
case "youtube": var params = _self.$video.data(); if(_self._supports_video()) params.html5 = 1; _self.player = new YT.Player(_self.$video.attr('id'), { videoId: params.videoid, height: _self.$video.attr('height'), width: _self.$video.attr('width'), playerVars: params, events: { 'onReady': function(){ _self.$option_container.trigger('av-video-loaded'); }, 'onError': function(player){ $.avia_utilities.log('YOUTUBE ERROR:', 'error', player); }, 'onStateChange': function(event){ if (event.data === YT.PlayerState.ENDED) { var command = _self.options.loop != false ? 'loop' : 'av-video-ended'; _self.$option_container.trigger(command); } } } });
isn’t it possible to insert here some code to close the iframe in
if (event.data === YT.PlayerState.ENDED)
December 20, 2016 at 4:41 pm #726646Hi!
Unfortunately JS is not my strongest suit. I will leave the thread open just in case my teammates have an idea but i am afraid you might need to hire a freelance developer for this one :/
Cheers!
YigitDecember 21, 2016 at 1:11 pm #726994for fancybox and other lightbox plugins there are (not so easy solutions) – but we have here on default an eventlistener implemented in enfold (aren’t we?) so in my JS suit (it is less than yours) i thought those JS Cracks here could handle it.
December 21, 2016 at 3:13 pm #727063Hi,
Unfortunately it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support.
However if you just like to run a function when youtube video in a modal window starts playing we can point you to some helpful resource please check
http://stackoverflow.com/questions/10773322/event-when-youtube-video-finished
http://stackoverflow.com/questions/2741493/detect-when-an-html5-video-finishesHowever if its really important for you to get this done, you can always hire a freelancer to do the job for you :)
Best regards,
Vinay- This reply was modified 7 years, 11 months ago by Vinay.
December 21, 2016 at 7:45 pm #727257thanks vinay – meanwhile i do all know these links.
But no link is helpful because on most of those hints the player was generated in an existing div.
The point is to run a function outside the iframe from inside.
Seems to be hardstuff. Can be closed -
AuthorPosts
- The topic ‘autoclose video lightbox ?’ is closed to new replies.