aboutsummaryrefslogtreecommitdiff
path: root/js/video.js
diff options
context:
space:
mode:
authorMohamed Mujahid <muja_dd@494418.no-reply.drupal.org>2010-07-06 17:04:02 +0000
committerMohamed Mujahid <muja_dd@494418.no-reply.drupal.org>2010-07-06 17:04:02 +0000
commit0c8e7ae689eed6291bb2061c9c75e3057b230339 (patch)
treef0a8ef699214db00367763ba5f30c748d106fd69 /js/video.js
parent8041073c8d74e5d24e3b9f10143f3e4bd04db2de (diff)
downloadvideo-0c8e7ae689eed6291bb2061c9c75e3057b230339.tar.gz
video-0c8e7ae689eed6291bb2061c9c75e3057b230339.tar.bz2
merging changes from DRUPAL-6--4
Diffstat (limited to 'js/video.js')
-rw-r--r--js/video.js84
1 files changed, 84 insertions, 0 deletions
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: '<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 });
+ }
+ },
+ });
+ });
+});
+
+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);
+ }
+ });
+
+}