Add support for .avi and .mpg videos
The Chief@gameb... - June 14, 2006 - 02:10
Project:	Video
Version:	cvs
Component:	Code
Category:	feature
Priority:	normal
Assigned:	Unassigned
Status:	active

Description

Good evening,

Adding the ability to upload .avi and .mpg videos I think this would be something necessary to add as well as the ability to upload your own videos directly from your computer to the server.

Thanks,

Charles
GameBGS.com
Updates
#1 submitted by fax8 on June 18, 2006 - 09:12

yeah... this is a reasonable feature.

The problem is: what player use for avi and mpeg ?

Usually Quicktime, Windows Media Player and RealPlayer are able of playing
such formats.
#2 submitted by The Chief@gameb... on June 18, 2006 - 22:04

I think Windows Media would be a good program, as thaty is what I am currently using to view all my .avi and .mpg videos.

I would just like to see this feature, and would allow me to upload many more videos on my site :)
#3 submitted by fax8 on June 18, 2006 - 23:16

yes.. but what about mac or linux users?
#4 submitted by Psicomante on June 19, 2006 - 08:28

it's very easy to create a little patch for you, Chief. Look at the code ;)
#5 submitted by The Chief@gameb... on June 19, 2006 - 14:12

I am a complete newbie for coding, and patching, i don't even know how to patch lmao :)
#6 submitted by khoogheem on June 26, 2006 - 02:01 new

One thought would be to allow the admin to pick the windows or the quicktime player.

The best option (IMHO) would be to try and grab the OS from the brower being used then we could also support the formats for linux users. But here is at least a method to give control to the admin:

FIXES---

add new code:
define('VIDEO_PLAYER_MPEG',        'video_player_mpeg');
define('VIDEO_PLAYER_AVI',          'video_player_avi');

define('QUICKTIME',                    'Apple Quicktime');
define('REALMEDIA',                    'Real Media');
define('FLASH',                            'Macromedia Flash Video');
define('SWF',                              'Macromedia Flash Video');
define('DCR',                              'Director Movie');
define('WINDOWS_MEDIA',            'Windows Media Format');
define('YOUTUBE',                        'YouTube Video');
define('GOOGLEVIDEO',                  'Google Video');

in function video_settings: - add to the end
  $form['players'] = array('#type' => 'fieldset', '#title' => t('Media Players'), '#description' => t('You can choose which player will be used for specific types of media'));
  $form['players'][VIDEO_PLAYER_MPEG] = array(
    '#type' => 'select',
    '#title' => t('Player to use for MPEG/MPG media files'),
    '#default_value' => variable_get(VIDEO_PLAYER_MPEG, WINDOWS_MEDIA),
    '#options' => drupal_map_assoc(array(QUICKTIME, WINDOWS_MEDIA)),
  );
  $form['players'][VIDEO_PLAYER_AVI] = array(
    '#type' => 'select',
    '#title' => t('Player to use for AVI media files'),
    '#default_value' => variable_get(VIDEO_PLAYER_AVI, WINDOWS_MEDIA),
    '#options' => drupal_map_assoc(array(QUICKTIME, WINDOWS_MEDIA)),
  );

in function video_play(): -- add the code:
      case 'mpeg':
      case 'mpg':
        if(variable_get(VIDEO_PLAYER_MPEG, WINDOWS_MEDIA) == WINDOWS_MEDIA){
          return theme('video_play_windowsmedia', $node);
        }
        else{
          return theme('video_play_quicktime', $node);
        }
      case 'avi':
        if(variable_get(VIDEO_PLAYER_AVI, WINDOWS_MEDIA) == WINDOWS_MEDIA){
          return theme('video_play_windowsmedia', $node);
        }
        else{
          return theme('video_play_quicktime', $node);
        }
#7 submitted by The Chief@gameb... on June 26, 2006 - 16:43 new

I hope this will be added to the module :)
#8 submitted by fax8 on July 16, 2006 - 10:16 new

@khoogheem

could you please send your modifications as a patch file?

Thanks

Fabio
