Skip to content

Commit

Permalink
Added max duration for red5recorder.
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitdbst committed Aug 8, 2012
1 parent cf70c5b commit a47c969
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Expand Up @@ -24,3 +24,4 @@
$string['norecordingfound'] = 'There is no sound recorded. Please use the red disc button to start recording. Use the black square button to stop recording.';
$string['nonamefound'] = 'Please provide a name for your recording.';
$string['filenotsaved'] = 'The file could not be saved! Please try again';
$string['maxlength'] = 'Max Length (in secs)';
11 changes: 8 additions & 3 deletions recorders/red5recorder/lib.php
Expand Up @@ -28,7 +28,7 @@ class repository_mediacapture_red5recorder extends recorder {
* @return array $options Array of type options used by the recorder
*/
public static function get_type_option_names() {
return array('rtmp_server', 'red5recorder');
return array('rtmp_server', 'max_length', 'red5recorder');
}

/**
Expand All @@ -42,6 +42,10 @@ public function add_config_form($mform) {
'maxlength="100" size="25" ');
$mform->setType('rtmp_server', PARAM_NOTAGS);
$mform->setDefault('rtmp_server', '127.0.0.1');
$mform->addElement('text', 'max_length', get_string('maxlength', 'repository_mediacapture'), null,
array('group' => 1));
$mform->setType('max_length', PARAM_INT);
$mform->setDefault('max_length', 90);
}

/**
Expand All @@ -51,12 +55,13 @@ public function add_config_form($mform) {
public function view($mform, $options) {
global $CFG;

$tmpname = sha1(uniqid(rand(), true));
$rtmpserver = $options['rtmp_server'];
$tmpname = sha1(uniqid(rand(), true));
$maxlength = $options['max_length'];
$streampath = "http://$rtmpserver:5080/red5recorder/streams/$tmpname.flv";

$url = new moodle_url("$CFG->wwwroot/repository/mediacapture/recorders/red5recorder/assets/red5recorder.swf");
$flashvars = "?server=rtmp://$rtmpserver/red5recorder/&fileName=$tmpname";
$flashvars = "?server=rtmp://$rtmpserver/red5recorder/&fileName=$tmpname&maxLength=$maxlength";

$recorder = '
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
Expand Down

0 comments on commit a47c969

Please sign in to comment.