To add permissions on the original download option I inserted some quick lines of code.

In flashvideo.module on line 149 I replaced return array('administer flashvideo'); with return array('administer flashvideo', 'download original');

Then in flashvideo-play.tpl.php I replaced

   <?php 
      $video_text = flashvideo_variable_get($video['node_type'], 'downloadtext', '');   
      $output = '';
      
      if(flashvideo_variable_get($video['node_type'], 'downloadfile', 0)) {
         if($video_text == '') {
            $output .= '<p>'. t('Download the original : '); 
            $output .= l(basename($video['original_video']), file_create_url($video['original_video']), array('title' => basename($video['original_video'])), NULL, NULL, TRUE) . '</p>';      
         }
         else {
            $output .= '<p>' . l($video_text, file_create_url($video['original_video']), array('title' => $video_text), NULL, NULL, TRUE) . '</p>';      
         }
      }
      
      print $output;
   ?>   

with

   <?php if (user_access('download original')) {
      $video_text = flashvideo_variable_get($video['node_type'], 'downloadtext', '');   
      $output = '';
      
      if(flashvideo_variable_get($video['node_type'], 'downloadfile', 0)) {
         if($video_text == '') {
            $output .= '<p>'. t('Download the original : '); 
            $output .= l(basename($video['original_video']), file_create_url($video['original_video']), array('title' => basename($video['original_video'])), NULL, NULL, TRUE) . '</p>';      
         }
         else {
            $output .= '<p>' . l($video_text, file_create_url($video['original_video']), array('title' => $video_text), NULL, NULL, TRUE) . '</p>';      
         }
      }
  }
      print $output;
   ?>   

Sorry that I can't make a patch, I don't really have the time or knowledge to do so, but I thought this would help others who don't want their bandwidth destroyed by hit and run anonymous users.

Comments

attheshow’s picture

Dear Krispy,

I was wondering why this solution is working out better for you than the "Add an original video download Link" option under your content type settings. Is it that you need some users to be able to download the original and not other users (you need to make downloading role-specific)?

Kripsy’s picture

Yes, it was to make it role specific. I wanted to exclude anonymous users from downloading the high quality file and let them only view the stream. This way I save on bandwidth and drive up registration. I imagine a lot of video sites could benefit from this.

attheshow’s picture

Version: 6.x-1.4 » 6.x-1.x-dev
Assigned: Unassigned » attheshow

Just committed to dev version.

attheshow’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

NPC’s picture

Is this also available for the case of FlashVideo using CCK FileField? I can't even find a corresponding setting, and enabling file list for the CCK field has no effect either. I may be missing something important, can you please help? I've tried this with admin and regular user (which as the permission set).