Skip to content

Commit

Permalink
Merge pull request #305 from ferishili/issue-279
Browse files Browse the repository at this point in the history
fixes #279
  • Loading branch information
ferishili authored Sep 9, 2021
2 parents 72c70c6 + 907462a commit 31a549a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 5 deletions.
22 changes: 21 additions & 1 deletion Driver/BigBlueButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ public function createMeeting(MeetingParameters $parameters)
unset($features['invite_moderator']);
}

// Remove extra feature param (room_anyone_can_start) which is not accaptable by BBB.
if (isset($features['room_anyone_can_start'])) {
unset($features['room_anyone_can_start']);
}

if ($features['record'] == 'true') {
if (self::checkRecordingCapability($features)) {
$params['name'] = $params['name'] . ' (' . date('Y-m-d H:i:s') . ')';
Expand All @@ -117,8 +122,18 @@ public function createMeeting(MeetingParameters $parameters)
$features['welcome'] = Driver::getConfigValueByDriver((new \ReflectionClass(self::class))->getShortName(), 'welcome');
}

// Handel Opencast Webcam Recording.
$opencast_webcam_record = false;
if (isset($features['opencast_webcam_record'])) {
$opencast_webcam_record = filter_var($features['opencast_webcam_record'], FILTER_VALIDATE_BOOLEAN);
unset($features['opencast_webcam_record']);
}

if (isset($features['meta_opencast-dc-isPartOf'])) {
$features['meta_opencast-dc-title'] = htmlspecialchars($params['name']);

// If the Opencast is responsible for recording, then we pass webcam recording flag as well.
$features['meta_opencast-add-webcams'] = $opencast_webcam_record;
}

$params = array_merge($params, $features);
Expand Down Expand Up @@ -343,7 +358,7 @@ private function buildQueryString($params)
{
$segments = array();
foreach ($params as $key => $value) {
if (filter_var($value, FILTER_VALIDATE_BOOLEAN) && $key != 'duration') {
if (is_bool($value) && $key != 'duration') {
$encoded_value = $value == true ? 'true' : 'false';
} else {
$encoded_value = rawurlencode($value);
Expand Down Expand Up @@ -451,6 +466,10 @@ public static function getRecordFeature()
$info = '';
if ($opencast_config) {
$info = _('Opencast wird als Aufzeichnungsserver verwendet. Diese Funktion ist im Testbetrieb und es kann noch zu Fehlern kommen.');

$res['opencast_webcam_record'] = new ConfigOption('opencast_webcam_record', dgettext(MeetingPlugin::GETTEXT_DOMAIN, 'Aufzeichnen von Webcams zulassen.'),
false, _('Sofern erlaubt, werden auch die Webcams aufgezeichnet. Das Opencast-System muss diese Funktion unterstützen, um diese Einstellung anzuwenden.'));

} else if ($record_config) {
$info = _('Erlaubt es Moderatoren, die Medien und Ereignisse in der Sitzung für die spätere Wiedergabe aufzuzeichnen. Die Aufzeichnung muss innerhalb der Sitzung von einem Moderator gestartet werden.');
}
Expand Down Expand Up @@ -495,6 +514,7 @@ public static function getFeatureDisplayArrangement()
'record_setting' => [
'duration',
'record',
'opencast_webcam_record',
'giveAccessToRecordings'
]
]
Expand Down
2 changes: 1 addition & 1 deletion vueapp/components/MeetingAdd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
<template v-for="(feature, index) in config[room['driver']]['features']['record']['record_setting']">
<MeetingAddLabelItem :ref="feature['name']" :room="room" :feature="feature" :maxDuration="maxDuration"
@labelClicked="labelClickHandler"
:badge="(Object.keys(config[room['driver']]).includes('opencast') && config[room['driver']]['opencast'] == '1'
:badge="(feature['name'] == 'record' && Object.keys(config[room['driver']]).includes('opencast') && config[room['driver']]['opencast'] == '1'
&& feature['info'].toLowerCase().includes('opencast')) ? {show: true, text: $gettext('beta')} : {}"
:key="index"/>
</template>
Expand Down
19 changes: 16 additions & 3 deletions vueapp/components/MeetingComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,20 @@
</span>
</div>
<div class="right">
<StudipTooltipIcon v-if="room.features && room.features.record && room.features.record == 'true' && !room.record_not_allowed"
<template v-if="room.features && room.features.record && room.features.record == 'true' && !room.record_not_allowed">
<StudipTooltipIcon v-show="opencast_webcam_record_enabled"
:text="$gettext('Bitte beachten Sie, dass dieser Raum aufgezeichnet wird! Die Webcams der Teilnehmer könnten auch aufgezeichnet werden!')"
:badge="true"
>
<StudipIcon icon="span-full" role="attention" size="11"></StudipIcon> <span v-text="'Rec + Webcam'"></span>
</StudipTooltipIcon>
<StudipTooltipIcon v-if="!opencast_webcam_record_enabled"
:text="$gettext('Bitte beachten Sie, dass dieser Raum aufgezeichnet wird!')"
:badge="true"
>
<StudipIcon icon="span-full" role="attention" size="11"></StudipIcon> {{'Rec'}}
</StudipTooltipIcon>
<StudipIcon icon="span-full" role="attention" size="11"></StudipIcon> <span v-text="'Rec'"></span>
</StudipTooltipIcon>
</template>
<a v-if="room.has_recordings" style="cursor: pointer;"
:title="$gettext('Die vorhandenen Aufzeichnungen')"
@click.prevent="getRecording()">
Expand Down Expand Up @@ -241,6 +249,11 @@ export default {
group_name = this.course_groups[this.room.group_id];
}
return group_name;
},
opencast_webcam_record_enabled() {
return (this.room && this.room.driver && this.room.features && this.room.features.opencast_webcam_record &&
JSON.parse(this.room.features.opencast_webcam_record) == true && this.config && Object.keys(this.config[this.room.driver]).includes('opencast') && this.config[this.room.driver].opencast == '1');
}
},
Expand Down

0 comments on commit 31a549a

Please sign in to comment.