From a9addd6ed7ab0e15e1d4b3db4c67ea9b00578d2d Mon Sep 17 00:00:00 2001 From: Heshan Date: Mon, 7 Mar 2011 22:37:41 +0530 Subject: Remove unwanted JS files and added manual thumbnail update on fallback and manual select. --- js/video.js | 112 +++++++++++++++++++++++++++++++----------------------------- 1 file changed, 57 insertions(+), 55 deletions(-) (limited to 'js/video.js') diff --git a/js/video.js b/js/video.js index 0a9711a..4a23b53 100644 --- a/js/video.js +++ b/js/video.js @@ -4,79 +4,81 @@ * Adds some show/hide to the admin form to make the UXP easier. * */ +(function($){ -$(document).ready(function() { - //lets see if we have any jmedia movies - if($.fn.media) { - $('.jmedia').media(); - } + $(document).ready(function() { + //lets see if we have any jmedia movies + if($.fn.media) { + $('.jmedia').media(); + } - video_hide_all_options(); - $("input[name='video_convertor']").change(function() { video_hide_all_options(); - }); + $("input[name='video_convertor']").change(function() { + video_hide_all_options(); + }); - // change metadata options - video_hide_all__metadata_options(); - $("input[name='video_metadata']").change(function() { + // change metadata options video_hide_all__metadata_options(); - }); + $("input[name='video_metadata']").change(function() { + video_hide_all__metadata_options(); + }); - // change metadata options - video_hide_all__filesystem_options(); - $("input[name='video_filesystem']").change(function() { + // change metadata options video_hide_all__filesystem_options(); - }); + $("input[name='video_filesystem']").change(function() { + video_hide_all__filesystem_options(); + }); - $('.video_select').each(function() { - var ext = $(this).attr('rel'); - $('select', this).change(function() { - if($(this).val() == 'video_play_flv') { + $('.video_select').each(function() { + var ext = $(this).attr('rel'); + $('select', this).change(function() { + if($(this).val() == 'video_play_flv') { + $('#flv_player_'+ext).show(); + } else { + $('#flv_player_'+ext).hide(); + } + }); + if($('select', this).val() == 'video_play_flv') { $('#flv_player_'+ext).show(); - } else { - $('#flv_player_'+ext).hide(); } }); - if($('select', this).val() == 'video_play_flv') { - $('#flv_player_'+ext).show(); - } - }); - if(Drupal.settings.video) { - $.fn.media.defaults.flvPlayer = Drupal.settings.video.flvplayer; + if(Drupal.settings.video) { + $.fn.media.defaults.flvPlayer = Drupal.settings.video.flvplayer; - } + } - //lets setup our colorbox videos - $('.video-box').each(function() { - var url = $(this).attr('href'); - var data = $(this).metadata(); - var width = data.width; - var height= data.height; - var player = Drupal.settings.video.player; //player can be either jwplayer or flowplayer. - $(this).colorbox({ - html: '', - onComplete:function() { - if(player == 'flowplayer') { - flowplayer("video-overlay", Drupal.settings.video.flvplayer, { - clip: { - autoPlay: Drupal.settings.video.autoplay, - autoBuffering: Drupal.settings.video.autobuffer - } - }); - } else { - $('#video-overlay').media({ - flashvars: { - autostart: Drupal.settings.video.autoplay + //lets setup our colorbox videos + $('.video-box').each(function() { + var url = $(this).attr('href'); + var data = $(this).metadata(); + var width = data.width; + var height= data.height; + var player = Drupal.settings.video.player; //player can be either jwplayer or flowplayer. + $(this).colorbox({ + html: '', + onComplete:function() { + if(player == 'flowplayer') { + flowplayer("video-overlay", Drupal.settings.video.flvplayer, { + clip: { + autoPlay: Drupal.settings.video.autoplay, + autoBuffering: Drupal.settings.video.autobuffer + } + }); + } else { + $('#video-overlay').media({ + flashvars: { + autostart: Drupal.settings.video.autoplay }, - width:width, - height:height - }); + width:width, + height:height + }); + } } - } + }); }); }); -}); +})(jQuery); function video_hide_all_options() { $("input[name='video_convertor']").each(function() { -- cgit v1.2.3