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

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

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


Revision 1.5 - (show annotations) (download) (as text)
Mon May 12 04:10:54 2008 UTC (18 months, 2 weeks ago) by alexua
Branch: MAIN
CVS Tags: DRUPAL-5--1-3, HEAD
Changes since 1.4: +4 -4 lines
File MIME type: text/x-php
Corrected all errors registered by Coder module in preperation for D6 port
1 <?php
2 // $Id: revver.inc,v 1.4 2008/02/08 16:50:24 alexua Exp $
3
4 define('VIDEO_CCK_REVVER_MAIN_URL', 'http://one.revver.com/revver');
5 define('VIDEO_CCK_REVVER_AFFILIATE_PROGRAM_URL', 'http://one.revver.com/revver/go/faq#makingmoney1');
6
7 function video_cck_revver_info() {
8 $name = t('Revver');
9 $features = array(
10 array(t('Affliate program'), t('Yes'), t('Not currently supported by other providers. Set affiliate ID above.')),
11 array(t('Autoplay'), t('Yes'), ''),
12 array(t('RSS Attachment'), t('No'), ''),
13 array(t('Thumbnails'), t('Yes'), t('May not currently resize thumbnails, but this will be easy to add. Meanwhile, you can override theme_video_cck_revver_thumbnail if you have a pressing need for this and know how to theme.')),
14 );
15 return array(
16 'provider' => 'revver',
17 'name' => $name,
18 'url' => VIDEO_CCK_REVVER_MAIN_URL,
19 'settings_description' => t('These settings specifically affect videos displayed from !provider.', array('!provider' => l($name, VIDEO_CCK_REVVER_MAIN_URL, array('target' => '_blank')))),
20 'supported_features' => $features,
21 );
22 }
23
24 function video_cck_revver_settings() {
25 $form = array();
26 $form['revver']['api'] = array(
27 '#type' => 'fieldset',
28 '#title' => t('Revver affiliate program'),
29 '#description' => t('You may share ad revenue if you publish Revver videos through their !program.', array('!program' => l('Affiliate Program', VIDEO_CCK_REVVER_AFFILIATE_PROGRAM_URL, array('target' => '_blank')))),
30 '#collapsible' => true,
31 '#collapsed' => true,
32 );
33 $form['revver']['api']['video_cck_revver_affiliate_id'] = array(
34 '#type' => 'textfield',
35 '#title' => t('Revver associate key'),
36 '#default_value' => variable_get('video_cck_revver_affiliate_id', '0'),
37 '#description' => t('If you have a Revver Affiliate ID, you may enter it here. This is not required for viewing videos, but will give you proper credit when doing so. You can find your Affiliate ID by examining the URL of a video while logged into their site.'),
38 );
39 return $form;
40 }
41
42 function video_cck_revver_extract($embed) {
43 return array(
44 '@revver\.com/video/([^/]*)/@i',
45 '@revver\.com/video/(.*)@i',
46 '@revver\.com/player/1\.0/player\.js\?mediaId\:([^;]*);@i',
47 );
48 }
49
50 function video_cck_revver_video_link($video_code) {
51 return 'http://one.revver.com/video/'. $video_code;
52 }
53
54 function theme_video_cck_revver_flash($embed, $width, $height, $autoplay) {
55 if ($embed) {
56 $autoplay = $autoplay ? ';flashvars:autoStart=true;' : '';
57 $output .= '<script src="http://flash.revver.com/player/1.0/player.js?mediaId:'. $embed .';affiliateId:'. check_plain(variable_get('video_cck_revver_affiliate_id', '0')) .';height:'. $height .';width:'. $width . $autoplay .';" type="text/javascript"></script>';
58 }
59 return $output;
60 }
61
62 function video_cck_revver_thumbnail($field, $item, $formatter, $node, $width, $height) {
63 return 'http://frame.revver.com/frame/'. $width .'x'. $height .'/'. check_plain($item['value']) .'.jpg';
64 }
65
66 function video_cck_revver_video($embed, $width, $height, $field, $item, $autoplay) {
67 $output = theme('video_cck_revver_flash', $embed, $width, $height, $autoplay);
68 return $output;
69 }
70
71 function video_cck_revver_preview($embed, $width, $height, $field, $item, $autoplay) {
72 $output = theme('video_cck_revver_flash', $embed, $width, $height, $autoplay);
73 return $output;
74 }

  ViewVC Help
Powered by ViewVC 1.1.2