Okay
  Public Ticket #393228
Video in portfolio item still plays if gallery is closed early
Closed

Comments

  • Chris started the conversation

    I'm testing putting a video as a portfolio item. All looks fine but if a visitor starts to watch a video and decides to close that portfolio item before the video has ended the video continues to play.

    Of course they could turn the video off first but that is not necessarily intuitive, most would expect closing that portfolio item would also stop the video.

    A visitor would find that annoying so I need to have it that closing that portfolio item also stops the video playing.

    What do I need to do to make that happen?

  •  1,823
    Support replied

    Hi Chris,

    the difficulty here is controlling the video embedded in html code.

    the project 'close' button has an event handler in /js/scripts.js lines 628 to 641 so that would a good place to stop the video

    a solution is to load the video using iframe API

    https://developers.google.com/youtube/iframe_api_reference

    for youtube videos.

    thanks


    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy