Embedded Media Field
Finally, we come to the alternative of hosting video from our own servers. Although using a module such as Media Mover combined with services such as Amazon S3 nukes serving video a slightly easier task than it might have otherwise been, for most sites the bandwidth required for serving video is generally not a viable option. Additionally, sites may wish to take advantage of the viral opportunities of hosting video through a widely recognized provider such as YouTube or Blip.TV.
There are several modules that provide some limited support for embedding third-party media, including both the Video and Asset modules. However, at the time of this writing, the most comprehensive and by far the easiest to configure and use is the Embedded Media Field, which includes the Embedded Video Field as part of its package.
Install both of these modules and set up a new content type with an Embedded Video Field. You will need, of course, to have the CCK (Content) module installed as well. As with our other examples, you will first add your type from Administer | Content management | Content types | Add content type (af/admiñ/ aenit ant'/ Í|fgSíSi;|add), give it a name such as Viifea, and add the field from Administer | Content management | Content types ¡ Video | Add field (at/admxB/sbrfgSrit/ node-type /^ilfeo / a dd_f i e Id).
Before continuing, I must confess a bias here. I wrote the original Embedded Media Field module with assistance from Sam Tresler during DrupalCamp NYC in 2007, and rewrote it for a more solid and flexible API during OSCMS later that year. I am also indebted to Alex UreVick-Ackelsberg for his assistance in the ongoing maintenance and support.
Embedded Video
3rd Parly Video
Without doing anything else, you may now add a new video from a provider by simply pas ting its URT into the field. The module will then au tomatically parse and display the video appropriately.
There are several settings on the following page that may be set, including allowed providers, video and thumbnail sizes, and whether the video plays automatically.
You may leave the providers alone to allow content from any of them, or select only the providers you wish to allow editors and users to use:
f Providers Supported
Select which third party providers you wish to allow for this content type from the list below. If no checkboxes are checked, then all providers will be supported. When a user submits new content, the URL they enter will lie matched to the provider, assuming that provider is allowed here.
Providers:
V Local Archive, org r Biip.tv
Brightcove
V Current TV I- Cooglc
V iFilm JumpCut
I Live Video MetaCafe I- MySpace I- Rewer Sevenload
V YouTube
I- Custom URL
The local checkbox is experimental at the time of this writing and may not actually be on the version you're reading. The module maintainers (myself included, of course) intend to hook into other APIs to provide better local video support without reinventing the wheel. That may or may not be ready by the time you read this book.
The Custom URL provider is also used to experimentally s up port direct videos from any source available from an HTTP request, including your local server. It is not recommended for general use, as it would be easy to use that to unethically hotlmk to videos from someone else's server. Hundreds of flying monkeys will hunt you down if you do that. Easically, always turn off support for that unless you have a specific (and moral) use for tl"iat feature.
You can set video sizes in the next sections for lull size and preview size video display. By default, videos will be displayed in full size. You can change the display to video preview or thumbnail at the display settings page, by browsing to Administer | Content management | Content types | Video | Display fields (at
/a drain/ content/node-type/video/ display).
Videos will be forced to display at the size provided here, regardless of how they are offered by the provider. You can also determine if the video will autoplay or not. For instance, you might use a small video preview for teasers and a larger full-size video when iriewmg the node page, turning on the autoplay in that case:
i? Video Display Settings
These settings control how this video is displayed in its full size, which defaults to 42 &:3 50.
Video display width: |425
The width of the video. It defaults to 425.
Video display height: (350
The height of tlie video. It defaults to 350.
i- Autoplay
If supported by the provider, checking tins hox will cause the video to autoluatically begin after tlie video loads w hen ui its full size.
V Video Preview Settings
These settings control how this video is displayed in its preview size, which defaults to 42 5:3 50.
Video preview width: [iil
The width of the preview video. It defaults to 425.
Video preview height: *
|35Q
The height of tlie preview video. It defaults to 350.
Autoplay
If supported by the provider, checking this hox will cause the video to automatically begin after tlie video loads when in its preview size.
Post a comment