Skip to content

Commit

Permalink
Merge branch 'master' into fix/codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
bluetom authored Nov 27, 2024
2 parents 05500b5 + 0b3b975 commit e8516e0
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 8 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"main-moodle": "MOODLE_405_STABLE",
"main-php": "8.3",
"main-oc": "16.6",
"ocs": ["16.6", "15.11"],
"main-db": "mariadb",
"moodle-php": {
"MOODLE_405_STABLE": ["8.1", "8.2"]
},
"moodle-plugin-ci": "4.4.5"
}
15 changes: 15 additions & 0 deletions .github/workflows/config_all.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"main-moodle": "MOODLE_405_STABLE",
"main-php": "8.3",
"main-oc": "16.6",
"ocs": ["16.6", "15.11"],
"main-db": "mariadb",
"moodle-php": {
"MOODLE_401_STABLE": ["7.4", "8.0", "8.1"],
"MOODLE_402_STABLE": ["8.0", "8.1", "8.2"],
"MOODLE_403_STABLE": ["8.0", "8.1", "8.2"],
"MOODLE_404_STABLE": ["8.1", "8.2", "8.3"],
"MOODLE_405_STABLE": ["8.1", "8.2", "8.3"]
},
"moodle-plugin-ci": "4.4.5"
}
4 changes: 2 additions & 2 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: Moodle Plugin CI

########################################################################################################################

on: [push, pull_request]
on: [ push, pull_request ]

########################################################################################################################

jobs:
call-moodle-ci-workflow:
uses: Opencast-Moodle/moodle-workflows-opencast/.github/workflows/moodle-ci.yml@master
uses: Opencast-Moodle/moodle-workflows-opencast/.github/workflows/moodle-ci.yml@main
with:
requires-tool-plugin: true
branch-tool-plugin: master
10 changes: 8 additions & 2 deletions classes/local/output_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,20 @@ public static function output_episode($ocinstanceid, $episodeid, $modinstanceid,
echo \html_writer::script('window.episode = ' . json_encode($data));
echo '<br>';

// Show error if there are no streams.
if (count($data['streams']) === 0) {
\core\notification::error(get_string('erroremptystreamsources', 'mod_opencast'));
echo $OUTPUT->footer();
return;
}

// Find aspect-ratio if there is only one video track.
if (count($data['streams']) === 1 && !empty($data['streams'][0]['sources'])) {
$sources = $data['streams'][0]['sources'];
$res = $sources[array_key_first($sources)][0]['res'];
$resolution = $res['w'] . '/' . $res['h'];
echo \html_writer::start_div('player-wrapper', ['style' => '--aspect-ratio:' . $resolution]);
} else {
\core\notification::error(get_string('erroremptystreamsources', 'mod_opencast'));
echo \html_writer::start_div('player-wrapper');
}

Expand Down Expand Up @@ -170,7 +176,7 @@ public static function output_download_menu($ocinstanceid, $episodeid, $modinsta

// Get the action menu options.
$actionmenu = new action_menu();
$actionmenu->set_alignment(action_menu::TL, action_menu::BL);
$actionmenu->set_menu_left();
$actionmenu->prioritise = true;
$actionmenu->actionicon = new pix_icon('t/down', get_string('downloadvideo', 'mod_opencast'));
$actionmenu->actiontext = 'Download';
Expand Down
4 changes: 4 additions & 0 deletions lang/en/opencast.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

// Let codechecker ignore some sniffs for this file as it is partly ordered semantically instead of alphabetically.
// phpcs:disable moodle.Files.LangFilesOrdering.UnexpectedComment
// phpcs:disable moodle.Files.LangFilesOrdering.IncorrectOrder

defined('MOODLE_INTERNAL') || die();

$string['advancedsettings'] = 'Advanced settings';
Expand Down
1 change: 1 addition & 0 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function opencast_supports($feature) {
case FEATURE_MOD_INTRO:
case FEATURE_SHOW_DESCRIPTION:
case FEATURE_BACKUP_MOODLE2:
case FEATURE_COMPLETION_TRACKS_VIEWS:
return true;
default:
return null;
Expand Down
9 changes: 5 additions & 4 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@
* Plugin version and other meta-data are defined here.
*
* @package mod_opencast
* @copyright 2024 Thomas Niedermaier <[email protected]>
* @copyright 2020 Tobias Reischmann <[email protected]>
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

$plugin->component = 'mod_opencast';
$plugin->release = 'v4.4-r1';
$plugin->version = 2024060400;
$plugin->requires = 2022112800; // Requires Moodle 4.1+.
$plugin->release = 'v4.5-r1';
$plugin->version = 2024111100;
$plugin->requires = 2024100700; // Requires Moodle 4.5+.
$plugin->maturity = MATURITY_STABLE;
$plugin->dependencies = [
'tool_opencast' => 2024060400,
'tool_opencast' => 2024111100,
];
5 changes: 5 additions & 0 deletions view.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
require_once(__DIR__ . '/lib.php');
require_once($CFG->dirroot . '/course/modlib.php');
require_once($CFG->libdir . '/gradelib.php');
require_once($CFG->libdir.'/completionlib.php');

global $OUTPUT, $DB, $PAGE;

Expand Down Expand Up @@ -86,6 +87,10 @@
$event->add_record_snapshot('opencast', $moduleinstance);
$event->trigger();

// Completion.
$completion = new completion_info($course);
$completion->set_module_viewed($cm);

if ($moduleinstance->type == opencasttype::EPISODE) {
output_helper::output_episode($moduleinstance->ocinstanceid, $moduleinstance->opencastid, $moduleinstance->id);
} else if ($moduleinstance->type == opencasttype::SERIES) {
Expand Down

0 comments on commit e8516e0

Please sign in to comment.