Configuring Feed API and Emfield
This chapter tells you how to configure Feed API and Embedded Media Field with the aim of importing several types of Media Feeds. The process also uses a helper module called Feed API Element Mapper.
If you want to include standard Media 2.0 podcasts you may need to install a patch if the host isn't one of the ones supported by the Embedded Media Field.
Embedded Media Field
To set up Embedded Media Field to only accept videos from the providers that you choose and to alter other settings then you should go to
Home > Administer > Content management > Embedded Media Field Configuration
Or you can set the settings for each content type that uses an Emfield. For example for the content type Video23 you should edit the settings here.
Home > Administer > Content management > Video 23
Here we've chosen some of the more popular video sharing sites. We've also chosen Custom URL. This allows us to map feeds from outside of these sites. There's more on this later in the chapter.
Configuring FeedAPI and Feed Element Mapper
Install required modules:
Download and unzip simplepie_1.1.3.zip and copy the simplepie.inc file into the sites/default/modules/feedapi/parser_simplepie
4) Enable required modules:
- Enable Content module
- Enable Embedded Media Field
- Enable Embedded Video Field
- Enable feedapi
- Enable feedapi_node
- Enable simplepie
Create new content type for the video items which contain an embedded_video field. There is help on this in another chapter.
Enable all (required) providers: navigate to admin/content/emfield/media and enable all providers
Create a YouTube test feed.
Create content > feed:
Title: YouTube G20
Feed URL: http://gdata.youtube.com/feeds/base/videos?q=g20&client=ytapi-youtube-search&alt=rss&v=2 (from a YouTube search for G20)
Under "Processors > FeedAPI Node"
For "Node type of feed items:" select "Video".
We need to 'Map' the original url field.
Select the 'Map' tab. options->original_url: to field_emvideo Save and refresh.
Result: 25 feed items from YouTube with embedded video
Custom URL Media Feeds in Embedded Media Field
The Embedded Media Field module can also work with custom URL's. This lets videos hosted on another site, or on the local server, to be embedded. An editor simply pastes the link they wish embedded into the field's textfield, or in our case for our aggregation site, we would be more likely to map an enclosed URL to the field.
We can use the ability of the Custom URL field to map Video podcast feeds from independent Video sites to our the Embeded Media Field.
However, not all video file types are supported at the moment, including avi files unfortunately. We'll need to install a patch to make this feature work with more files.
embedded_video_zz_custom_ur patchAllows more metadata to be added the Custom URL array))
How it works in a nutshell
If a URL based provider isn't found, then based the media enclosures of each feed item are parsed in to the Embedded media field.
To set this up you need to, when mapping feeds set options > enclosure or options > raw > enclosure to map to the Embedded media field
What the patch will do is to go through the feed and create an array of information that it thinks will be useful. It will then store that data in the Embedded Media Field, as a Custom URL.
The kind of information that it will look for is
- Enclosed media file (mp4, avi, etc)
- Metadata in the enclosures, video length, file size, dimensions, codec
Section to add
Need to get the patch from ekes in a download link
and do new screen shots with a feed from blip.tv with flv and with mp4 / avi enclosures
How to aggregate a third party Media feed feed Step by Step
- Import a feed from ifiwatch.tv
- Create content > feed:
- Title: IFI Watch TV
- Feed URL: http://www.ifiwatch.tv/en/video/feed
- Under "Processors > FeedAPI Node"
- For "Node type of feed items:" select "Video".
- Map options->original_url: to field_emvideo
Save and refresh.
Result: 10 feed items created from ifiwatch.tv but with NO embedded video
9) Solution: Apply patche written by ekes:
- ssh in the server
- cd sites/all/modules/
- cd ../emfield
- patch -p0 < emfield.emvideo.zzz_custom_url.20090418.patch
10) edit the ifiwatch.tv feed,
- modify the mapped fields
- map "options > enclosures" to "emvideo field"
Result: The first video file found in the enclosures from the ifiwatch.tv feed is now mapped to the emvideo field.
If there are multiple video files found in the enclosures, and the embedded video field allows multiple values, the mapper will map multiple video files.