How to add Zoopy video to your Drupal site using CCK and the Embedded Media Field module

Submitted by charles on

I recently created a provider plugin for Drupal's CCK emfield module which allows you allows you to embed a Zoopy video by pasting the url into a cck field:

zoopy page url pasted into cck field

This is a lot easier than having to copy the embed code provided by Zoopy and paste this into a textarea.

The provider plugin then extracts the video code and displays the video on your Drupal site:

zoopy video embedded automatically

Instructions how to install the Zoopy provider file

First install the emfield module (http://drupal.org/project/emfield). You need to have the cck content module enabled and both the Embedded Media Field and Embedded Video Field:

Because the Zoopy provider file does not form part of the default emfield module, you will need to paste the zoopy.inc file available for download here, into your emfield video provider directory. This is a different folder in drupal 5 and in drupal 6:

Drupal 5: sites\all\modules\emfield\contrib\video_cck\providers
Drupal 6: sites\all\modules\emfield\contrib\emvideo\providers

If your server is running PHP < 5.2 you'll need to include an extra file as I use the php function json_decode which is only available in PHP versions 5.2 or greater. I put this file in a folder called php_scripts in my theme folder. If you want to put this file somewhere else you'll have to change this path in the function zoopy_get_json_data. This file is also available for download here. It's called JSON-for-PHP-less-than-5-2.zip and you obviously need to unzip it first.

You can also change the display of the video so that it displays as a clickable thumbnail in views, which on click can take you to the video node or the video in a thickbox popup (if thickbox is installed):

That's it - you should now be able to easily add Zoopy video to your Drupal site using CCK.