| Línea 43... |
Línea 43... |
| 43 |
$settings->add($setting);
|
43 |
$settings->add($setting);
|
| 44 |
}
|
44 |
}
|
| Línea 45... |
Línea 45... |
| 45 |
|
45 |
|
| 46 |
// Types allowed.
|
46 |
// Types allowed.
|
| 47 |
$options = [
|
47 |
$options = [
|
| 48 |
'both' => new lang_string('audioandvideo', 'tiny_recordrtc'),
|
48 |
\tiny_recordrtc\constants::TINYRECORDRTC_AUDIO_TYPE => new lang_string('onlyaudio', 'tiny_recordrtc'),
|
| 49 |
'audio' => new lang_string('onlyaudio', 'tiny_recordrtc'),
|
49 |
\tiny_recordrtc\constants::TINYRECORDRTC_VIDEO_TYPE => new lang_string('onlyvideo', 'tiny_recordrtc'),
|
| 50 |
'video' => new lang_string('onlyvideo', 'tiny_recordrtc')
|
50 |
\tiny_recordrtc\constants::TINYRECORDRTC_SCREEN_TYPE => new lang_string('onlyscreen', 'tiny_recordrtc'),
|
| 51 |
];
|
51 |
];
|
| 52 |
$name = get_string('allowedtypes', 'tiny_recordrtc');
|
52 |
$name = get_string('allowedtypes', 'tiny_recordrtc');
|
| 53 |
$desc = get_string('allowedtypes_desc', 'tiny_recordrtc');
|
53 |
$desc = get_string('allowedtypes_desc', 'tiny_recordrtc');
|
| - |
|
54 |
$default = [
|
| - |
|
55 |
\tiny_recordrtc\constants::TINYRECORDRTC_AUDIO_TYPE => 1,
|
| - |
|
56 |
\tiny_recordrtc\constants::TINYRECORDRTC_VIDEO_TYPE => 1,
|
| 54 |
$default = 'both';
|
57 |
];
|
| 55 |
$setting = new admin_setting_configselect('tiny_recordrtc/allowedtypes', $name, $desc, $default, $options);
|
58 |
$setting = new admin_setting_configmulticheckbox('tiny_recordrtc/allowedtypes', $name, $desc, $default, $options);
|
| Línea 56... |
Línea 59... |
| 56 |
$settings->add($setting);
|
59 |
$settings->add($setting);
|
| 57 |
|
60 |
|
| 58 |
// Audio bitrate.
|
61 |
// Audio bitrate.
|
| 59 |
$name = get_string('audiobitrate', 'tiny_recordrtc');
|
62 |
$name = get_string('audiobitrate', 'tiny_recordrtc');
|
| - |
|
63 |
$desc = get_string('audiobitrate_desc', 'tiny_recordrtc');
|
| - |
|
64 |
$options = [];
|
| - |
|
65 |
foreach (\tiny_recordrtc\constants::TINYRECORDRTC_AUDIO_BITRATES as $rate) {
|
| - |
|
66 |
$kbrate = $rate / 1000;
|
| - |
|
67 |
$options[$rate] = get_string('kbrate', 'tiny_recordrtc', $kbrate);
|
| - |
|
68 |
}
|
| - |
|
69 |
$setting = new admin_setting_configselect(
|
| - |
|
70 |
name: 'tiny_recordrtc/audiobitrate',
|
| 60 |
$desc = get_string('audiobitrate_desc', 'tiny_recordrtc');
|
71 |
visiblename: $name,
|
| - |
|
72 |
description: $desc,
|
| - |
|
73 |
defaultsetting: \tiny_recordrtc\constants::TINYRECORDRTC_AUDIO_BITRATES[5],
|
| 61 |
$default = '128000';
|
74 |
choices: $options,
|
| Línea 62... |
Línea 75... |
| 62 |
$setting = new admin_setting_configtext('tiny_recordrtc/audiobitrate', $name, $desc, $default, PARAM_INT, 8);
|
75 |
);
|
| 63 |
$settings->add($setting);
|
76 |
$settings->add($setting);
|
| 64 |
|
77 |
|
| 65 |
// Video bitrate.
|
78 |
// Video bitrate.
|
| 66 |
$name = get_string('videobitrate', 'tiny_recordrtc');
|
79 |
$name = get_string('videobitrate', 'tiny_recordrtc');
|
| 67 |
$desc = get_string('videobitrate_desc', 'tiny_recordrtc');
|
80 |
$desc = get_string('videobitrate_desc', 'tiny_recordrtc');
|
| Línea -... |
Línea 81... |
| - |
|
81 |
$default = '2500000';
|
| - |
|
82 |
$setting = new admin_setting_configtext('tiny_recordrtc/videobitrate', $name, $desc, $default, PARAM_INT, 8);
|
| - |
|
83 |
$settings->add($setting);
|
| - |
|
84 |
|
| - |
|
85 |
// Screen bitrate.
|
| - |
|
86 |
$name = get_string('screenbitrate', 'tiny_recordrtc');
|
| - |
|
87 |
$desc = get_string('screenbitrate_desc', 'tiny_recordrtc');
|
| 68 |
$default = '2500000';
|
88 |
$default = '2500000';
|
| 69 |
$setting = new admin_setting_configtext('tiny_recordrtc/videobitrate', $name, $desc, $default, PARAM_INT, 8);
|
89 |
$setting = new admin_setting_configtext('tiny_recordrtc/screenbitrate', $name, $desc, $default, PARAM_INT, 8);
|
| 70 |
$settings->add($setting);
|
90 |
$settings->add($setting);
|
| 71 |
|
91 |
|
| 72 |
// Audio recording time limit.
|
92 |
// Audio recording time limit.
|
| Línea 92... |
Línea 112... |
| 92 |
return get_string('timelimitwarning', 'tiny_recordrtc');
|
112 |
return get_string('timelimitwarning', 'tiny_recordrtc');
|
| 93 |
}
|
113 |
}
|
| 94 |
return '';
|
114 |
return '';
|
| 95 |
});
|
115 |
});
|
| 96 |
$settings->add($setting);
|
116 |
$settings->add($setting);
|
| - |
|
117 |
|
| - |
|
118 |
// Screen recording time limit.
|
| - |
|
119 |
$name = get_string('screentimelimit', 'tiny_recordrtc');
|
| - |
|
120 |
$desc = get_string('screentimelimit_desc', 'tiny_recordrtc');
|
| - |
|
121 |
// Validate screentimelimit greater than 0.
|
| - |
|
122 |
$setting = new admin_setting_configduration('tiny_recordrtc/screentimelimit', $name, $desc, $defaulttimelimit);
|
| - |
|
123 |
$setting->set_validate_function(function(int $value): string {
|
| - |
|
124 |
if ($value <= 0) {
|
| - |
|
125 |
return get_string('timelimitwarning', 'tiny_recordrtc');
|
| - |
|
126 |
}
|
| - |
|
127 |
return '';
|
| - |
|
128 |
});
|
| - |
|
129 |
$settings->add($setting);
|
| - |
|
130 |
|
| - |
|
131 |
// Screen output settings.
|
| - |
|
132 |
// Number of items to display in a box.
|
| - |
|
133 |
$options = [
|
| - |
|
134 |
\tiny_recordrtc\constants::TINYRECORDRTC_SCREEN_HD => get_string('screenresolution_hd', 'tiny_recordrtc'),
|
| - |
|
135 |
\tiny_recordrtc\constants::TINYRECORDRTC_SCREEN_FHD => get_string('screenresolution_fhd', 'tiny_recordrtc'),
|
| - |
|
136 |
];
|
| - |
|
137 |
$name = get_string('screensize', 'tiny_recordrtc');
|
| - |
|
138 |
$desc = get_string('screensize_desc', 'tiny_recordrtc');
|
| - |
|
139 |
$default = '1280,720';
|
| - |
|
140 |
$setting = new admin_setting_configselect('tiny_recordrtc/screensize', $name, $desc, $default, $options);
|
| - |
|
141 |
$settings->add($setting);
|
| - |
|
142 |
|
| - |
|
143 |
// Pausing allowed.
|
| - |
|
144 |
$options = [
|
| - |
|
145 |
'1' => new lang_string('yes'),
|
| - |
|
146 |
'0' => new lang_string('no'),
|
| - |
|
147 |
];
|
| - |
|
148 |
|
| - |
|
149 |
$name = get_string('allowedpausing', 'tiny_recordrtc');
|
| - |
|
150 |
$setting = new admin_setting_configselect('tiny_recordrtc/allowedpausing', $name, '', 0, $options);
|
| - |
|
151 |
$settings->add($setting);
|
| - |
|
152 |
|
| - |
|
153 |
// Audio format selection.
|
| - |
|
154 |
$audioformatoptions = [
|
| - |
|
155 |
'0' => get_string('audiortcformatdefault', 'tiny_recordrtc'),
|
| - |
|
156 |
'1' => get_string('audiortcformatmp3', 'tiny_recordrtc'),
|
| - |
|
157 |
];
|
| - |
|
158 |
$setting = new admin_setting_configselect(
|
| - |
|
159 |
name: 'tiny_recordrtc/audiortcformat',
|
| - |
|
160 |
visiblename: get_string('audiortcformat', 'tiny_recordrtc'),
|
| - |
|
161 |
description: '',
|
| - |
|
162 |
defaultsetting: 0,
|
| - |
|
163 |
choices: $audioformatoptions,
|
| - |
|
164 |
);
|
| - |
|
165 |
$settings->add($setting);
|
| 97 |
}
|
166 |
}
|