Commit 19ec4a9d authored by robertDouglass's avatar robertDouglass

Initial commit as module project

parents
*******************************************************************************
D R U P A L M O D U L E
*******************************************************************************
Name: Media module
Authors: Robert Douglass -- rob *AT* robshouse /dot/ net
Alan Evans -- alanevans *AT* tiscali /dot/ de
Sponsored by Webs4.com
*******************************************************************************
INSTALLATION:
1. Copy the entire media folder to your drupal/modules directory.
The entire folder "getid3" may be moved to a location of your choice, as you can change the path in the admin settings later on.
2. Patch the upload.module file in modules/ using the file upload.module.patch.txt
2. Create the database tables using the media.module.mysql.sql file. This module has only been tested with MySQL.
3. From your Drupal site, enable the media module in "administer > modules".
You will also need to enable the upload module to be able to attach files to nodes.
It is also recommended that you have menu module enabled, to have the option of enabling optional menu items provided by media module
4. On your Drupal site, go to "administer > settings > media". If you want to have the getId4 library in a differnt location, input the path to the getid3.php FILE (not the folder) and click "Update". Drupal will check the location of the library and if it succeeds, will show a list of supported types. Check the boxes of media types you wish to have media module handle and click update. The other setting on this page allows you to set the number of items that will be shown in the summaries of playlists that appear on the homepage.
5. You may at this point want to make the media module's link visible in the main menu. To do so, go to "administer > menus" and click the "enable" link for "multi-media", setting up the details for the menu item on the page that follows.
6. Don't forget to set up the appropriate permissions, which on the current version of Drupal is located under "administer > access control"
\ No newline at end of file
*******************************************************************************
D R U P A L M O D U L E
*******************************************************************************
Name: Media module
Authors: Robert Douglass -- Rob *AT* robshouse /dot/ net
Alan Evans -- alanevans *AT* tiscali /dot/ de
Last update: 19th February 2005
Drupal: 4.5.2, 4.6.0
Sponsored by Webs4.com
*******************************************************************************
Description
-----------
The media module recognises certain types of audio and video files (types set by the administrator) and analyses any metadata present in those files. This information is stored in a metadata database table, and can be viewed, allowing users with the right permissions to either stream or download audio or video files. The module also allows the creation of a new type of node - the playlist - from those files, which can then be played by clicking a play button, assuming the user has a media player installed.
Requirements
------------
Tested on Drupal versions 4.5.2 and 4.6.0
Tested using MySQL database only.
This module requires the GetID3 library pre version 2 (current version is at the time of writing 1.7.2), which is supplied in the media folder. Updates to this library are available from sourceforge.net The media module is not designed for operation with getid3 version 2 (currently beta)
Installation
------------
See INSTALL.txt
Getting Started
---------------
After following the installation instructions, the media file types that you specified in the admin section will be recognised automatically when you attach them to any node type that accepts attachments. You may need to alter site settings under "admin > settings" concerning file upload/download, and "administer > uploads" to set the maximum upload size.
Playlists can be created by clicking on the multi-media (or the name that you may have chosen for this item) link in the menu and clicking the "create playlist" subtab. Items are added to the paylist from the table by clicking "2pl" under "actions".
Alternatively, you can create a playlist by clicking "create content". Give the playlist a title to begin with and submit it. On the confirmation page, there is, in addition to the normal edit and view tabs also a "add/change content" tab. Clicking this tab takes you to the same table where you may select items to add to the playlist. Your changes are only added to your playlist when "save" is clicked.
Notes
-----
TODO
----
In preparation
Planned Features
----------------
In preparation
This diff is collapsed.
# phpMyAdmin SQL Dump
# version 2.5.7-pl1
# http://www.phpmyadmin.net
#
# Host: localhost
# Generation Time: Jan 28, 2005 at 11:09 PM
# Server version: 4.0.20
# PHP Version: 4.3.4
#
# Database : `fxy`
#
# --------------------------------------------------------
#
# Table structure for table `av_metadata`
#
CREATE TABLE `audio_metadata` (
`fid` int(10) unsigned NOT NULL default '0',
`fileformat` varchar(64) default NULL,
`audio_dataformat` varchar(64) default NULL,
`audio_channels` int(2) unsigned default NULL,
`audio_sample_rate` int(10) unsigned default NULL,
`audio_bitrate` int(10) unsigned default NULL,
`audio_channelmode` varchar(64) default NULL,
`audio_compression_ratio` varchar(64) default NULL,
`audio_codec` varchar(64) default NULL,
`audio_encoder` varchar(64) default NULL,
`id3_title` varchar(128) default NULL,
`id3_artist` varchar(128) default NULL,
`id3_album` varchar(128) default NULL,
`id3_comment` varchar(128) default NULL,
`id3_track` varchar(128) default NULL,
`id3_genre` varchar(128) default NULL,
`id3_year` varchar(128) default NULL,
`encoding` varchar(128) default NULL,
`playtime_seconds` varchar(128) default NULL,
`playtime_string` varchar(128) default NULL,
PRIMARY KEY (`fid`)
) TYPE=MyISAM;
CREATE TABLE `video_metadata` (
`fid` int(10) unsigned NOT NULL default '0',
`fileformat` varchar(64) default NULL,
`video_bitrate` int(10) unsigned default NULL,
`video_resolution_x` int(10) unsigned default NULL,
`video_resolution_y` int(10) unsigned default NULL,
`video_frame_rate` int(10) unsigned default NULL,
`video_pixel_aspect_ratio` int(2) unsigned default NULL,
`video_bits_per_sample` int(10) unsigned default NULL,
`video_codec` varchar(64) default NULL,
`video_compression_ratio` varchar(64) default NULL,
`encoding` varchar(128) default NULL,
`playtime_seconds` varchar(128) default NULL,
`playtime_string` varchar(128) default NULL,
PRIMARY KEY (`fid`)
) TYPE=MyISAM;
#
# Table structure for table `av_playlist`
#
CREATE TABLE `av_playlist` (
`nid` int(10) NOT NULL default '0',
`fid` int(10) NOT NULL default '0',
`next_fid` int(10) NOT NULL default '0',
KEY `nid` (`nid`)
) TYPE=MyISAM;
Index: upload.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload.module,v
retrieving revision 1.28
diff -u -r1.28 upload.module
--- upload.module 8 Feb 2005 19:43:02 -0000 1.28
+++ upload.module 19 Feb 2005 09:02:45 -0000
@@ -263,7 +263,7 @@
foreach ($node->files as $file) {
if ($file->list) {
$files[] = $file;
- }
+ }
}
if (count($files) > 0) {
// RSS only allows one enclosure per item
@@ -300,8 +300,10 @@
// Insert new files:
if ($file = file_save_upload($file, $file->filename)) {
$fid = db_next_id('{files}_fid');
+ $file->fid = $fid;
db_query("INSERT INTO {files} (fid, nid, filename, filepath, filemime, filesize, list) VALUES (%d, %d, '%s', '%s', '%s', %d, %d)",
$fid, $node->nid, $file->filename, $file->filepath, $file->filemime, $file->filesize, $node->list[$key]);
+ module_invoke_all('fileapi', 'insert', $file);
}
}
else {
@@ -309,9 +311,11 @@
if ($node->remove[$key]) {
file_delete($file->filepath);
db_query("DELETE FROM {files} WHERE fid = %d", $key);
+ module_invoke_all('fileapi', 'delete', $file);
}
if ($file->list != $node->list[$key]) {
db_query("UPDATE {files} SET list = %d WHERE fid = %d", $node->list[$key], $key);
+ module_invoke_all('fileapi', 'update', $file);
}
}
}
@@ -324,6 +328,7 @@
file_delete($file->filepath);
}
db_query("DELETE FROM {files} WHERE nid = %d", $node->nid);
+ module_invoke_all('fileapi', 'delete', $file);
}
function upload_form($node) {
@@ -359,6 +364,7 @@
$result = db_query("SELECT * FROM {files} WHERE nid = %d", $node->nid);
while ($file = db_fetch_object($result)) {
$files[$file->fid] = $file;
+ module_invoke_all('fileapi', 'load', $file);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment