/[drupal]/contributions/modules/emfield/contrib/video_cck/providers/spike.inc
ViewVC logotype

Contents of /contributions/modules/emfield/contrib/video_cck/providers/spike.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (show annotations) (download) (as text)
Mon Jun 23 15:22:43 2008 UTC (17 months ago) by aaron
Branch: MAIN
CVS Tags: DRUPAL-5--1-3, HEAD
Branch point for: DRUPAL-6--1
Changes since 1.3: +5 -2 lines
File MIME type: text/x-php
Add TODO for thumbnails for spike.tv (aaron).
1 <?php
2 // $Id: spike.inc,v 1.3 2008/05/12 04:10:54 alexua Exp $
3
4 define('VIDEO_CCK_SPIKE_MAIN_URL', 'http://www.spike.com/');
5
6 function video_cck_spike_info() {
7 $name = t('Spike TV');
8 $features = array(
9 array(t('Autoplay'), t('No'), t('In the works...')),
10 array(t('RSS Attachment'), t('No'), ''),
11 array(t('Thumbnails'), t('In the works...'), ''),
12 );
13 return array(
14 'provider' => 'spike tv',
15 'name' => $name,
16 'url' => VIDEO_CCK_SPIKE_MAIN_URL,
17 'settings_description' => t('These settings specifically affect videos displayed from !spike.', array('!spike' => l($name, VIDEO_CCK_SPIKE_MAIN_URL, array('target' => '_blank')))),
18 'supported_features' => $features,
19 );
20 }
21
22 function video_cck_spike_settings() {
23 $form = array();
24 return $form;
25 }
26
27 function video_cck_spike_extract($embed) {
28 return array(
29 // http://www.spike.com/video/2836119/collection/19459/channel/comedy
30 // <embed width="448" height="365" src="http://www.spike.com/efp" quality="high" bgcolor="000000" name="efp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="flvbaseclip=2836119&"> </embed> <h1><a href="http://www.spike.com/video/2836119">"I Lost It" with Tom Cruize and Jesus</a></h1><span>Posted Mar 25, 2007</span><p>What happens when Jesus, Abe Lincoln, Tom Cruise, Dustin Hoffman, Buddha and Einstein play a friendly game of poker?</p>
31 '@spike\.com/video/([^/&"\?]*)@i',
32 );
33 }
34
35 function video_cck_spike_request($embed, $cacheable = TRUE) {
36 return NULL;
37 }
38
39 function video_cck_spike_video_link($video_code) {
40 return 'http://www.spike.com/video/'. $video_code;
41 }
42
43 function theme_video_cck_spike_flash($embed, $width, $height, $autoplay) {
44 // TODO: figure out autoplay...
45 //<embed width="448" height="365" src="http://www.spike.com/efp" quality="high" bgcolor="000000" name="efp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="flvbaseclip=2952560&"> </embed>
46 if ($embed) {
47 $autoplay = $autoplay ? ' autoplay="true"' : '';
48 $output = '<embed width="'. $width .'" height="'. $height .'" src="http://www.spike.com/efp" quality="high" bgcolor="000000" name="efp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="flvbaseclip='. $embed .'"> </embed>';
49 }
50 return $output;
51 }
52
53 /**
54 * TODO: Is this correct? Using ifilmpro for thumbnails.
55 */
56 function video_cck_spike_thumbnail($field, $item, $formatter, $node, $width, $height) {
57 $picturelink = substr($item['value'], 0, 7);
58 return 'http://img1.ifilmpro.com/resize/image/stills/films/resize/istd/'. $picturelink .'.jpg?width='. $width;
59 }
60
61 function video_cck_spike_video($embed, $width, $height, $field, $item, $autoplay) {
62 $output = theme('video_cck_spike_flash', $embed, $width, $height, $autoplay);
63 return $output;
64 }
65
66 function video_cck_spike_preview($embed, $width, $height, $field, $item, $autoplay) {
67 $output = theme('video_cck_spike_flash', $embed, $width, $height, $autoplay);
68 return $output;
69 }

  ViewVC Help
Powered by ViewVC 1.1.2