This module is a video field for cck. Requires cck (content) module. Tested on 4.7.4

CCK seems to be the future with its great flexibility. It made sense to make a video field.

I took the cck link module and cut out what I didn't need and added code from the video module.

It handles all the video types that the video module currently supports. Though I only confirmed that Flash .flv worked. Everything else should still work. I would appreciate feedback to confirm.

It is relatively basic right now. With 3 fields. A url of the video, width, and height.
Only url is required, width and height are optional and default to 425 and 350.

For flash video it requires /ufo.js from http://www.bobbyvandersluis.com/ufo/
and uses /flvplayer.swf from http://www.jeroenwijering.com/?item=Flash_Video_Player
both of which I hardcoded to be in the root directory.

I would appreciate any feedback on how to improve it.

CommentFileSizeAuthor
vid.module22.38 KBagilpwc

Comments

Anonymous’s picture

Hi there,

Thanks for taking the time to make this module. I plan on using it on my production, to display FLV's, site once the redesign is finished. I've installed your module on my testing server and I was very pleased with the results. It's a very simple module that works as advertised.

However, I did see one problem that I don't really know how to fix myself, I've never submitted a patch before but, hopefully I can point you or someone else in the right direction.

The embedded player did not validate in XHTML. The same problem seems to exist with the embedding of FlowPlayer in the video.module. FlowPlayer did in fact blog about this issue recently and they pointed to this article that seems to offer a solution to the problem.

Anyway, just thought I would point that out. Hopefully this can be fixed before my new site launch so it can be a feature in it.

Thanks again for your work,
txcrew

Anonymous’s picture

One more thing,

I forgot to mention the embedded player on http://www.jeroenwijering.com/?item=Flash_Video_Player seems to validate too. I'm not sure what goes wrong when embedded in drupal.

-txcrew

Anonymous’s picture

I apologize for the multiple posts, but I think I got it to validate by giving a closer look to the source of http://www.jeroenwijering.com/?item=Flash_Video_Player.

I found that they included a CDATA section (http://www.w3schools.com/xml/xml_cdata.asp) so I just changed around line 318:

  $output .= '<script type="text/javascript">
	var FO = {movie:"/flvplayer.swf", width:"'. $width .'", height:"'. $height .'", majorversion:"8", build:"0", bgcolor:"#FFFFFF", flashvars:"file='. $url .'&showdigits=true&autostart=false&showfsbutton=false" };
	UFO.create(FO,"player1");
</script>';

to

  $output .= '<script type="text/javascript">
  //<![CDATA[
	var FO = {movie:"/flvplayer.swf", width:"'. $width .'", height:"'. $height .'", majorversion:"8", build:"0", bgcolor:"#FFFFFF", flashvars:"file='. $url .'&showdigits=true&autostart=false&showfsbutton=false" };
	UFO.create(FO,"player1");
	//]]>
</script>';

and now it validates as xhtml. I don't know if it was the best solution, as I am not a coder by any means, but just thought I would throw it in.

karens’s picture

There is no video field in CCK, so I'm not sure what any of these posts are referring to.

karens’s picture

Category: task » feature
Status: Active » Needs work

Oops. I missed the very first file attachment, so this is a *proposed* video field for CCK. I'll re-categorize this.

Anonymous’s picture

Just a thought...

Would it be possible to put in a feature if the module if the video field is not a required field in the CCK node type then it doesn't have the error saying the video type is not supported?

Thanks,
txcrew

yched’s picture

@agilpwc : thanks for taking the time to implement and submit this.
It seems that other people are following the same tracks :
see http://drupal.org/node/106833 by Duke.

Maybe you could get in touch with them and merge your efforts ? We should really avoid duplicating functionality in separate contrib modules...

(sorry for this not being a proper review of your code :-) )

ardas’s picture

Greate !
I'll look at it today and probably upload my version of video module.

I would like to discuss an idea not to include video player in video field module because most clients prefer to user players they found and it is probably a problem if it is hardcoded unless there is an ability to customize it somehow. What do you think?

ardas’s picture

Well, I studied your module today and found that you were focusing on how to display video data. When I was developing video module I was focusing on how to read and store video data. I still have no player at all and I didn't solve this task yet. On the other hand I have more columns for my field where all video specific data are stored. I'm using getid3 lib to read them.

This module was made from filefield and imagefield.
I created a project here http://drupal.org/project/mediafield.

How about we continue our mutual work upon this project together? I can give you CVS access to it ...

ardas’s picture

Well, I studied your module today and found that you were focusing on how to display video data. When I was developing video module I was focusing on how to read and store video data. I still have no player at all and I didn't solve this task yet. On the other hand I have more columns for my field where all video specific data are stored. I'm using getid3 lib to read them.

This module was made from filefield and imagefield.
I created a project here http://drupal.org/project/mediafield.

How about we continue our mutual work upon this project together? I can give you CVS access to it ...

maastrix’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev
Priority: Normal » Critical

I have been waiting for ages for this option. I would like to add a videofield to my custom created content types so I can tell what my videopage looks like..

yched’s picture

Version: 5.x-1.x-dev » 4.7.x-1.2
Priority: Critical » Normal

The patch provided here is announced to be 4.7 compatible, so I think it is safer to leave it for 4.7 version.
And 'critical' does not only mean 'much awaited' :-)

maastrix’s picture

yeah sorry.. thought i was editing my settings.. to me it's critical and i'm using 5.0 as of 1 hour ago ;)

yched’s picture

Status: Needs work » Fixed

Media Field project exists now

killes@www.drop.org’s picture

Status: Fixed » Closed (fixed)