Creating a Video Content Type with CCK

This is a hands on demo to create a video content that uses subtitles as well. We will cover the  CCK modules that are needed to create a video type with subtitles.

The aim is to be able to upload a video to your site of any type, and for that to be transcoded (i.e.converted) into a video type that can be displayed in a streaming video player. This can be done using the open OGG file format, in this chapter we will look at how to do it with FLV flash video.

Preparation

To create the content type , you need to have the following modules installed along with core content CCK module.

  • Text
  • Number
  • Options Widget
  • File Field

Getting Started

You need to set up a content type with 3 CCK fields for:

  • Video file, which you will upload
  • Subtitle files (text)
  • FLV video, which you will get when you've transcoded the video

There are a few different possibilities for how to do this. You could set up a simple text field, in this way you can paste in the URL of the files. This will be useful if for example you are linking to external videos to save bandwidth . Although it's harder to set up the system to do it for the subtitle files.

In this example we will set up a content type with video file and subtitle files uploaded via the CCK file field module.

To do this first create a new content type. To create create a new content type Navigate to Administer » Content management » Content types /admin/content/types/ and click on the Add button.

a_b_drupal_contenttypes_4

Then enter the following data about the Video content file.

subtitles_drupal_1 

You shouldn't change any of the other settings for this form. So you can click on Save Content Type when you have filled in the data.

You will then see new content type appear in the list of existing ones. Click on the manage fields link.

a_b_drupal_contenttypes_5 

Video Upload Field

Now we will add the first field. This will be where the Video file from your computer gets uploaded to. Enter the following data.


a_b_drupal_contenttypes_6

Now click on Save

On the next screen you need to decide what help text to show to users, what type of video files you let your users upload and the maximum size those videos are allowed to be. Do this by entering the following data or changing it.

a_b_drupal_contenttypes_7

Now click on Save Field Settings

We are going to repeat the process for two other file fields. One for Subtitle file which users will upload and another for the FLV video into which our video file will be converted.

Subtitle Upload Field

Let's add a field for the subtitle file. To do this repeat the steps above but enter the following information. 

a_b_drupal_contenttypes_8 

And on the following screen we will set the allowed subtitle types to only srt files, as they are the ones that are compatible with the player we are going to use later (JW player).

a_b_drupal_contenttypes_9 

FLV Video Field

Finally for our last video type for FLV repeat the same steps but put in the following information into the forms.

a_b_drupal_contenttypes_10 

And you can add some help text and set the type of file to be uploaded to be only an FLV file.

a_b_drupal_contenttypes_11

After adding these three fields, your settings should look something like this.

a_b_drupal_contenttypes_12 

This doesn't have to be the end of the fields you add to your Video with Subtitles content type, you can add other information like Name of Producer, Date Produced etc, but we are going to leave it there as this amount of information will do the trick for what we need.




your comment:
name :
comment :

If you can't read the word, click here
word :