1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Auto-close prettyphoto window when YouTube video ends

Discussion in 'JavaScript' started by goneinsane, Mar 9, 2012.

  1. #1
    I don't know a whole lot about jquery but I'm running prettyphoto on my website. I was wondering if anyone knew of a way that I can make it close on it's own after a YouTube video has played. I'm using prettyphoto for just the YouTube video so there's nothing else for it to scroll through.

    Does anyone know what I could do to make this happen?
     
    goneinsane, Mar 9, 2012 IP
  2. blacknet

    blacknet Active Member

    Messages:
    709
    Likes Received:
    16
    Best Answers:
    2
    Trophy Points:
    70
    #2
    check the google documentation for youtube player events, then check the prettyphoto documentation on how to close the window, then effectively write a line of code which says video.onFinish = function() { prettyphoto.close() } - sorry I can't be more help, but if I was then I'd go and look at that documentation and tell you, rather than you learn yourself - should only take 2 minutes.
     
    blacknet, Mar 12, 2012 IP
  3. goneinsane

    goneinsane Well-Known Member

    Messages:
    303
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    130
    #3
    I have read the documentation but I have no idea where to put this in the prettyphoto script. I've tried in a few spots and it doesn't work. I think I'll have to hire someone for this job. Thanks anyways.
     
    goneinsane, Mar 15, 2012 IP
  4. m4st3rm

    m4st3rm Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #4
    Have you found a solution to the problem?
    I'm in the exact same situation.
     
    m4st3rm, Aug 16, 2014 IP