We had the need to allow users to access the original videos, so I wrote this patch to allow the ability to give users the link to the source video. This allows for the flash video to be used for the regular users, and the users more interested can click on the link below the video for the original, non FLV video. (our content is scientific videos that researchers may be interested in) The patch here allows an admin to select in the control panel "Download Original Video." which will then place a link right below the window with the download link.

Flashvideo.module:

426,431d415
<    $form['ffmpeg']['flashvideo_' . $node_type .'_download_original_video'] = array(
<        '#type' => 'checkbox',
<        '#title' => t('Download Original Video.'),
<        '#default_value' => variable_get('flashvideo_' . $node_type .'_download_original_video', 0),
<        '#description' => t("Checking this checkbox will give the user the option of downloading the originial video.  Delete original video must be unchecked for this to work.")
<        );
932c915
<       $video_file = db_fetch_object(db_query("SELECT f.filepath, fv.width, fv.height, fv.oid FROM {flashvideo} fv LEFT JOIN {files} f ON f.fid = fv.fid WHERE (f.nid = %d) AND (f.filemime='flv-application/octet-stream') AND (fv.status=3) AND (fv.video_index=%d)", $nid, $index));
---
>       $video_file = db_fetch_object(db_query("SELECT f.filepath, fv.width, fv.height FROM {flashvideo} fv LEFT JOIN {files} f ON f.fid = fv.fid WHERE (f.nid = %d) AND (f.filemime='flv-application/octet-stream') AND (fv.status=3) AND (fv.video_index=%d)", $nid, $index));
939c922
<          $video_file = db_fetch_object(db_query("SELECT f.filepath, fv.width, fv.height, fv.oid FROM {flashvideo} fv LEFT JOIN {files} f ON f.fid = fv.fid WHERE (f.fid = %d) AND (f.filemime='flv-application/octet-stream') AND (fv.status=3)", $fid));
---
>          $video_file = db_fetch_object(db_query("SELECT f.filepath, fv.width, fv.height FROM {flashvideo} fv LEFT JOIN {files} f ON f.fid = fv.fid WHERE (f.fid = %d) AND (f.filemime='flv-application/octet-stream') AND (fv.status=3)", $fid));
953,957d935
<       
<       if(variable_get('flashvideo_' . $video['nodetype'] . '_download_original_video',false)&& !variable_get('flashvideo_' . $video['nodetype'] . '_delete_original_video',false)){
<         $video['original_path'] = db_result(db_query("SELECT filepath from {files} where fid = %d",$video_file->oid));
<       }
< 

flashvideo_objects.inc

35,37d33
<   if(variable_get('flashvideo_' . $video['nodetype'] . '_download_original_video', 0)){
<     $output .= '<div id = "flashvideo_original_download"> <a href="'. file_create_url($video['original_path']).'">'.t("Download original video").'</a>';
<   }

Comments

hrmes’s picture

Hello Papile!

This patch is exactly what i was looking for. I'm new to patching files and I've read in the forums that Cygwin works very well, which I've eventually installed. The patch for the flashvideo_objects.inc worked very well, but the patchcode for the flashvideo.module is causing errors like "Hunk #2 FAILED at 932". I don't know whether you are using cygwin, but do you have an idea what's wrong?

Thank you for any advices!
hrmes

travist’s picture

I have already got you covered buddy! I have included this in the latest version of the module. You just go to the FlashVideo Settings and then find the check box that says Add an original video download Link, and you are done!!!

travist’s picture

Status: Needs review » Fixed
hrmes’s picture

works perfect now!

Thank you,
hrmes

Anonymous’s picture

Status: Fixed » Closed (fixed)

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