Hello, is it possible to remove the link "download raw video file"? Part of the appeal of this service is to have an added measure of content security.

Comments

kylebrowning’s picture

You can override the function theme_cdn2_video_asset_metadata in your template.php.

Copy the original function, and paste it inside function PHPTEMPLATE_cdn2_video_asset_metadata

kylebrowning’s picture

Status: Active » Closed (fixed)
shaundychko’s picture

Wow Kyle, thanks for such a quick reply. If you don't mind, could you please be very explicit with your instructions? I am a beginning user, and I'm not sure where to find the PHPTEMPLATE_cdn2_video_asset_metadata function. When you mention the template.php file, I presume you mean the one in /public_html/themes/MyTemplate? Where can I find the function theme_cdn2_video_asset_metadata?

Also, just to confirm, is it true that, after the download link is removed, that the only way a user could possibly copy the video is by using a screen capture program?

Thank you very much for the help!

shaundychko’s picture

Status: Closed (fixed) » Active
kylebrowning’s picture

Typically, themes are installed in /WEBROOT/sites/all/themes or /WEBROOT>/sites/SITENAME/themes. This allows for an easy upgrade of Drupal from one version to the next, as you can rewrite everything in drupal core over itself, except obviously, the sites folder.

Youll want to paste this in your template.php

Basically I commented out that line, and with this override, you can safely update cdn2.module in the future.

function phptemplate_cdn2_video_asset_metadata(&$node, $asset, $preset) {
  $items = array();
  $title = t('File Information:');
  $item = t('Duration: ');
  // TODO: theme the video length into DD:MM:SS
  $item .= ($asset['video_length'] === NULL) ? 'unknown' : theme('cdn2_asset_video_length', $asset['video_length']);
  $items[] = $item;
  $item =  t('File Size: ');
  // TODO: 
  $item .= ($asset['file_size'] === NULL) ? 'unknown' : theme('cdn2_asset_file_size', $asset['file_size']);
  $items[] = $item;
  $item = t('File Format: ');
  switch ($preset->fileFormat) {
    case 'FLASH':
      $item .= t('Flash Video (FLV)');
      break;
    case 'MOV':
      $item .= t('Quicktime (MOV)');
      break;
    default: 
      $item .= $preset->fileFormat;
      break;
  }
  $items[] = $item;
  //$items[] = l('Download raw video file', $asset['asset_fetch_url']);
  //Commented out the line above to remove text
  return theme('item_list', $items, $title);
}
shaundychko’s picture

Status: Active » Closed (fixed)

Thank you Kyle, this works great.