Drupal aggregating multiple files from enclosures
Contents |
Aggregating and displaying Multiple files from RSS into Drupal
This possibility depends on a patch by ekes Media_Enclosure_parser_patch
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
This information is contained in a sample feed below
When this data is put into Drupals database it looks like this
Here's a close up of that. As Techies would say, it parses the enclosure infomration as a serialised array.
Displaying Multiple items in feeds
What happens if you allow multiple items for a Video type and there are more than one media items stored in the array you've stored in the database.
To do basic test of this we would change the number of items allowed in the Embed Media Field you've created to map the content to
Go to manage the settings for your Embed Media Field
At the bottom of the page under Global settings change the setting to unlimited.
If you save this then and you go back to the default view of the your video content type, then if there are multiple versions of the video file data in the Embed Media Field arrays then you'll see them all. In the case below there are two streaming versions of the video.
This is because the database has two version on there.
Theming output from Embeded Media Field
To avoid the random multiple output of these different version you'll need to 'theme' the output of the Embedded Media Field.
A common case
other info
In order to store as much use useful data as possible add patch embedded_video_zz_custom_url, which adds more understanding of mime types to the Custom URL provider.







