From 0c8e7ae689eed6291bb2061c9c75e3057b230339 Mon Sep 17 00:00:00 2001 From: Mohamed Mujahid Date: Tue, 6 Jul 2010 17:04:02 +0000 Subject: merging changes from DRUPAL-6--4 --- js/video.js | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 js/video.js (limited to 'js/video.js') diff --git a/js/video.js b/js/video.js new file mode 100644 index 0000000..e724e8b --- /dev/null +++ b/js/video.js @@ -0,0 +1,84 @@ +// $Id$ + +/** + * @file + * Adds some show/hide to the admin form to make the UXP easier. + * + */ + +$(document).ready(function() { + //lets see if we have any jmedia movies + if($.fn.media) { + $('.jmedia').media(); + } + + video_hide_all_options(); + $("input[name='vid_convertor']").change(function() { + video_hide_all_options(); + }); + + $('.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(); + } + }); + + 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}, width:width, height:height }); + } + }, + }); + }); +}); + +function video_hide_all_options() { + $("input[name='vid_convertor']").each(function() { + var id = $(this).val(); + $('#'+id).hide(); + if ($(this).is(':checked')) { + $('#' + id).show(); + } + }); +} + +function videoftp_thumbnail_change() { + // Add handlers for the video thumbnail radio buttons to update the large thumbnail onchange. + $(".video-thumbnails input").each(function() { + var path = $(this).val(); + if($(this).is(':checked')) { + var holder = $(this).attr('rel'); + $('.'+holder+' img').attr('src', Drupal.settings.basePath + path); + } + }); + +} -- cgit v1.2.3