aboutsummaryrefslogtreecommitdiff
path: root/video.install
blob: b52b78af65751e45525acccc89469451bc3a1fa5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?php
// $Id$
/**
 * @file
 * Provide installation functions for video.module .
 *
 * @author Heshan Wanigasooriya <heshan at heidisoft dot com>
 *                              <heshanmw at gmail dot com>
 * @todo
 */

/**
 * Implementation of hook_schema().
 */
function video_schema() {
  $schema['video'] = array(
    'description' => t('Store video files informations'),
    'fields' => array(
      'vid' => array(
        'description' => t('Prmary Key: {video}.vid of the video node'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'nid' => array(
        'description' => t('Node id, index to the {node}.nid'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),      
      'vtype' => array(
        'description' => t('The type of the video'),
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'vidfile' => array(
        'description' => t('Video file name / path'),
        'type' => 'text',
        'not null' => FALSE,
        'default' => '',
      ),
      'videox' => array(
        'description' => t('resolution : x'),
        'type' => 'int',
        'size' => 'small',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'videoy' => array(
        'description' => t('resolution : y'),
        'type' => 'int',
        'size' => 'small',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'size' => array(
        'description' => t('size of the video file'),
        'type' => 'int',
        'size' => 'big',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
      'download_counter' => array(
        'description' => t('No. of downloads of the video'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'play_counter' => array(
        'description' => t('No. of play times per video'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'video_bitrate' => array(
        'description' => t('Bit rate of the video'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
      'audio_bitrate' => array(
        'description' => t('Bit rate of the audio'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
      'audio_sampling_rate' => array(
        'description' => t('Sampling rate of the video'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
      'audio_channels' => array(
        'description' => t('Chenells of the audio'),
        'type' => 'text',
        'not null' => FALSE,
      ),
      'playtime_seconds' => array(
        'description' => t('Play time of the video'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
      'download_folder' => array(
        'description' => t('download folder'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'disable_multidownload' => array(
        'description' => t('enable/disable multi download'),
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'use_play_folder' => array(
        'description' => t('use play folder'),
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'serialized_data' => array(
        'description' => t('Informations related to the videos'),
        'type' => 'text',
        'not null' => FALSE,
      ),
    ),
     'indexes' => array(
     'nid' => array('nid'),
    ),
    'primary key' => array('vid'),
  );

  return $schema;
}

/**
 * Implementation of hook_install().
 */
function video_install() {
	drupal_install_schema('video');
  
  // default values for some variables use for resolution stuff
  variable_set('video_resolution_1_name', '16:9 - Widescreen');
  variable_set('video_resolution_1_value', '400x226');
  variable_set('video_resolution_2_name', '4:3 - Television');
  variable_set('video_resolution_2_value', '400x300');
}

/**
 * Implementation of hook_uninstall().
 */
function video_uninstall() {
  drupal_uninstall_schema('video');
  variable_del('video_resolution_1_name');
  variable_del('video_resolution_1_value');
  variable_del('video_resolution_2_name');
  variable_del('video_resolution_2_value');
}