aboutsummaryrefslogtreecommitdiff
path: root/js/video.js
diff options
context:
space:
mode:
authorHeshan Wanigasooriya <heshanmw@gmail.com>2010-12-05 12:56:20 +0000
committerHeshan Wanigasooriya <heshanmw@gmail.com>2010-12-05 12:56:20 +0000
commitb6e86040dd3faa3a70ec16e77220d852bdb09a04 (patch)
treecdb4282446dfb0efd750b87a7aaedd30229f0ff9 /js/video.js
parent973537f36c8f33473a00190aa64fc30b82d94c04 (diff)
downloadvideo-b6e86040dd3faa3a70ec16e77220d852bdb09a04.tar.gz
video-b6e86040dd3faa3a70ec16e77220d852bdb09a04.tar.bz2
Adding latest files.
Diffstat (limited to 'js/video.js')
-rw-r--r--js/video.js122
1 files changed, 122 insertions, 0 deletions
diff --git a/js/video.js b/js/video.js
new file mode 100644
index 0000000..015724f
--- /dev/null
+++ b/js/video.js
@@ -0,0 +1,122 @@
+// $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();
+ });
+
+ // change metadata options
+ video_hide_all__metadata_options();
+ $("input[name='vid_metadata']").change(function() {
+ video_hide_all__metadata_options();
+ });
+
+ // change metadata options
+ video_hide_all__filesystem_options();
+ $("input[name='vid_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') {
+ $('#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);
+ }
+ });
+
+}
+
+function video_hide_all__metadata_options() {
+ $("input[name='vid_metadata']").each(function() {
+ var id = $(this).val();
+ $('#'+id).hide();
+ if ($(this).is(':checked')) {
+ $('#' + id).show();
+ }
+ });
+}
+
+function video_hide_all__filesystem_options() {
+ $("input[name='vid_filesystem']").each(function() {
+ var id = $(this).val();
+ $('#'+id).hide();
+ if ($(this).is(':checked')) {
+ $('#' + id).show();
+ }
+ });
+}