diff options
Diffstat (limited to 'js/video.js')
-rw-r--r-- | js/video.js | 112 |
1 files changed, 57 insertions, 55 deletions
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: '<a id="video-overlay" href="'+url+'" style="height:'+height+'; width:'+width+'; display: block;"></a>', - 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: '<a id="video-overlay" href="'+url+'" style="height:'+height+'; width:'+width+'; display: block;"></a>', + 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() { |