function emvideo_twistage_data in Embedded Media Field 6
Same name and namespace in other branches
- 6.3 contrib/emvideo/providers/twistage.inc \emvideo_twistage_data()
Implementation of hook_PROVIDER_data().
1 call to emvideo_twistage_data()
- emvideo_twistage_rss in contrib/
emvideo/ providers/ twistage.inc - Implementation of hook_PROVIDER_rss().
File
- contrib/
emvideo/ providers/ twistage.inc, line 68 - Provide support for Twistage to the emfield.module (http://twistage.com).
Code
function emvideo_twistage_data($field, $item) {
// Create the initial data for the enclosure with the thumbnail and asset.
$data = array(
'emvideo_twistage_version' => 1,
'thumbnail' => array(
'filepath' => emvideo_twistage_thumbnail(NULL, $item, NULL, NULL, 300, 250),
'width' => 300,
),
'filepath' => 'http://service.twistage.com/videos/' . $item['value'] . '/play',
);
// Obtain the file types.
$response = emfield_request_header('twistage', $data['filepath']);
if ($response->code == 200) {
$data['filesize'] = $response->headers['Content-Length'];
$data['filemime'] = $response->headers['Content-Type'];
}
return $data;
}