I've recently started using prettyphoto to display a video.
This is my current setup
<link rel="stylesheet" href="/css/prettyPhoto.css" type="text/css" media="screen" charset="utf-8" /> <script src="/js/jquery.prettyPhoto2.js" type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8"> $(document).ready(function(){ var lastClicked = null; $("a[rel^='prettyPhoto']").prettyPhoto({ callback: function() { if(lastClicked != null) { var topicid = lastClicked.data("topicid"); $.post('/course/close-video', {topic_id: topicid }); lastClicked = null; } } }).click(function (){ lastClicked = $(this); }); </script> <a data-topicid="<?php echo $topic->topic_id;?>" href="/course/play-video/topic_id/<?php echo $topic->topic_id;?>?iframe=true&width=470&height=340" rel="prettyPhoto" title="<?php echo $topic->topic_name;?>"> <img src="/images/videos/<?php echo $image_name;?>" width="170" height="103" alt="<?php echo $topic->topic_name;?>"/> </a>
This is what is happening
1) When a user clicks on the link - the play-video php action is called which retrives the video url from database and passes so that it can be played on the popup window. This works fine.
2) Now the play-video also generates a unique id which is passed on to the page (iframe window) where the video is played. Right now I'm just displaying that value on the page. I can have that unique id stored as a hidden field or as a div value.
3) Now when the user closes this window - how can I access this unique id in the callback function of pretty photo which is in the main page.
Thanks a lot Appreciate your time