So, I’m trying to make a single page list with thumbnails, and when you click on them..video will basically popup. I’m using as a player the latest JW Player (5.8) and latest jQuery.
Everything works well, however, only on the first “pop”. When I close my first “pop” and open a new video, the player doesn’t load.
I first though, that the problem is, that I’m .remove()‘ing the player-container (for the obvious reason, that videos wont stay playing on the background and/or that videos wouldn’t get mixed up generally). However it wasn’t the .remove().
My plugin-function to pop the videos is:
$.fn.AllfilmVideoPopper = function () {
return this.each(function () {
var permalink = $(this);
$(permalink).click(function () {
$('body').append(
$body_overlay = $('<div class="body_overlay" />').append(
$wrapper = $('<div id="video_popper_wrapper">').append(
$closing_button = $('<div id="video_close" />'),
$player = $('<div id="video_popper" />')
).centerit()
)
);
$body_overlay.fadeIn();
jwplayer("video_popper").setup({
flashplayer: vp_video_player,
file: 'http://www.youtube.com/watch?v=WrjwaqZfjIY',
width: 800,
height: 400,
skin: vp_video_skin
});
$closing_button.click(function () {
$body_overlay.fadeOut('fast', function () {
// $player.remove();
})
});
return false;
});
});
};
Code is still raw, as I’m developing it. With only one test video
Note: vp_video_player and vp_video_skin are predefined JW Player files related parameters, that basically include the CMS’s theme-location to the player.swf and skin location.
So what I did, was I created a standalone page, that has JW Player in it. Only thing PHP in it, is the $_GET[‘vid’] to the source-file-video-file-url.
Then I modifed my launcher script’s 1 line:
to
Then removed the original player-loading-function alltogether
jwplayer(“video_popper”).setup(); // etc..
And it basically seems to work like I originally wanted. And no pre-generated hidden on the background content is needed for this, as iframes are pretty outdated, however still dynamical in their nature.
See it working here: http://www.alta.ee/groomlake/jw-player-popup-problem/video-list.html