From 1de52c9577f0859c1e113c7f6a01146434cb2eff Mon Sep 17 00:00:00 2001 From: Daniel Thies Date: Tue, 10 Oct 2023 07:55:59 -0500 Subject: [PATCH] VID-707: Prepare release candidate --- .github/workflows/moodle-ci.yml | 13 ++- amd/build/player.min.js | 2 +- amd/build/player.min.js.map | 2 +- amd/src/player.js | 4 +- classes/plugininfo/videotimeplugin.php | 12 +- classes/videotime_instance.php | 104 +++++++++--------- lib.php | 5 +- plugin/live/classes/external/join_room.php | 33 +++++- plugin/live/classes/external/publish_feed.php | 29 ++++- plugin/live/classes/external/renew_token.php | 26 ++++- plugin/live/lang/en/videotimeplugin_live.php | 4 +- plugin/live/version.php | 8 +- thirdpartylibs.xml | 2 +- version.php | 6 +- 14 files changed, 169 insertions(+), 81 deletions(-) diff --git a/.github/workflows/moodle-ci.yml b/.github/workflows/moodle-ci.yml index 64d9d060..73c65981 100644 --- a/.github/workflows/moodle-ci.yml +++ b/.github/workflows/moodle-ci.yml @@ -31,15 +31,18 @@ jobs: - php: '8.0' moodle-branch: 'master' database: 'pgsql' - - php: '8.0' + - php: '8.1' moodle-branch: 'master' database: 'mariadb' - - php: '8.0' - moodle-branch: 'MOODLE_402_STABLE' + - php: '8.1' + moodle-branch: 'MOODLE_403_STABLE' database: 'pgsql' - php: '8.0' - moodle-branch: 'MOODLE_402_STABLE' + moodle-branch: 'MOODLE_403_STABLE' database: 'mariadb' + - php: '8.0' + moodle-branch: 'MOODLE_402_STABLE' + database: 'pgsql' steps: - name: Check out repository code @@ -101,7 +104,7 @@ jobs: run: moodle-plugin-ci mustache - name: Grunt - if: ${{ matrix.moodle-branch == 'MOODLE_402_STABLE' }} + if: ${{ matrix.moodle-branch == 'MOODLE_403_STABLE' }} run: moodle-plugin-ci grunt - name: PHPUnit tests diff --git a/amd/build/player.min.js b/amd/build/player.min.js index d25dd02c..d3c983ae 100644 --- a/amd/build/player.min.js +++ b/amd/build/player.min.js @@ -1,3 +1,3 @@ -var e,t;e=window,t=function(){function r(e,t){for(var n=0;nname) { case 'pro': $info = array( - 'maturity' => MATURITY_STABLE, - 'release' => '1.7.1', - 'version' => 2023050100, + 'maturity' => MATURITY_RC, + 'release' => '1.8 RC', + 'version' => 2023101100, ); break; case 'repository': $info = array( - 'maturity' => MATURITY_STABLE, - 'release' => '1.7.1', - 'version' => 2023011202, + 'maturity' => MATURITY_RC, + 'release' => '1.8', + 'version' => 2023101100, ); break; } diff --git a/classes/videotime_instance.php b/classes/videotime_instance.php index df63a23c..ae52737c 100644 --- a/classes/videotime_instance.php +++ b/classes/videotime_instance.php @@ -27,6 +27,8 @@ use cm_info; use core_component; use core_external\external_description; +use core_external\external_single_structure; +use core_external\external_value; use mod_videotime\local\tabs\tabs; use mod_videotime\output\next_activity_button; use renderer_base; @@ -508,57 +510,57 @@ public function export_for_template(renderer_base $output) { * @return external_description */ public static function get_external_description(): external_description { - return new \external_single_structure([ - 'id' => new \external_value(PARAM_INT), - 'course' => new \external_value(PARAM_INT), - 'name' => new \external_value(PARAM_RAW), - 'intro' => new \external_value(PARAM_RAW), - 'introformat' => new \external_value(PARAM_INT), - 'vimeo_url' => new \external_value(PARAM_URL), - 'video_description' => new \external_value(PARAM_RAW), - 'video_description_format' => new \external_value(PARAM_INT), - 'timemodified' => new \external_value(PARAM_INT), - 'completion_on_view_time' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'completion_on_view_time_second' => new \external_value(PARAM_INT, '', VALUE_OPTIONAL), - 'completion_on_finish' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'completion_on_percent' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'completion_on_percent_value' => new \external_value(PARAM_INT, '', VALUE_OPTIONAL), - 'autoplay' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'byline' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'color' => new \external_value(PARAM_TEXT, '', VALUE_OPTIONAL), - 'height' => new \external_value(PARAM_TEXT, '', VALUE_OPTIONAL), - 'maxheight' => new \external_value(PARAM_TEXT, '', VALUE_OPTIONAL), - 'maxwidth' => new \external_value(PARAM_TEXT, '', VALUE_OPTIONAL), - 'muted' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'playsinline' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'portrait' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'speed' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'title' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'transparent' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'type' => new \external_value(PARAM_TEXT, '', VALUE_OPTIONAL), - 'autopause' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'background' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'controls' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'pip' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'dnt' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'width' => new \external_value(PARAM_TEXT, '', VALUE_OPTIONAL), - 'responsive' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'label_mode' => new \external_value(PARAM_INT, '', VALUE_OPTIONAL), - 'viewpercentgrade' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'next_activity_button' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'next_activity_id' => new \external_value(PARAM_INT, '', VALUE_OPTIONAL), - 'next_activity_auto' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'option_loop' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'resume_playback' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'resume_time' => new \external_value(PARAM_INT, '', VALUE_OPTIONAL), - 'preview_picture' => new \external_value(PARAM_INT, '', VALUE_OPTIONAL), - 'show_description' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'show_title' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'show_tags' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'show_duration' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'show_viewed_duration' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), - 'columns' => new \external_value(PARAM_INT, '', VALUE_OPTIONAL), - 'preventfastforwarding' => new \external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + return new external_single_structure([ + 'id' => new external_value(PARAM_INT), + 'course' => new external_value(PARAM_INT), + 'name' => new external_value(PARAM_RAW), + 'intro' => new external_value(PARAM_RAW), + 'introformat' => new external_value(PARAM_INT), + 'vimeo_url' => new external_value(PARAM_URL), + 'video_description' => new external_value(PARAM_RAW), + 'video_description_format' => new external_value(PARAM_INT), + 'timemodified' => new external_value(PARAM_INT), + 'completion_on_view_time' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'completion_on_view_time_second' => new external_value(PARAM_INT, '', VALUE_OPTIONAL), + 'completion_on_finish' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'completion_on_percent' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'completion_on_percent_value' => new external_value(PARAM_INT, '', VALUE_OPTIONAL), + 'autoplay' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'byline' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'color' => new external_value(PARAM_TEXT, '', VALUE_OPTIONAL), + 'height' => new external_value(PARAM_TEXT, '', VALUE_OPTIONAL), + 'maxheight' => new external_value(PARAM_TEXT, '', VALUE_OPTIONAL), + 'maxwidth' => new external_value(PARAM_TEXT, '', VALUE_OPTIONAL), + 'muted' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'playsinline' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'portrait' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'speed' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'title' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'transparent' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'type' => new external_value(PARAM_TEXT, '', VALUE_OPTIONAL), + 'autopause' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'background' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'controls' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'pip' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'dnt' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'width' => new external_value(PARAM_TEXT, '', VALUE_OPTIONAL), + 'responsive' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'label_mode' => new external_value(PARAM_INT, '', VALUE_OPTIONAL), + 'viewpercentgrade' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'next_activity_button' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'next_activity_id' => new external_value(PARAM_INT, '', VALUE_OPTIONAL), + 'next_activity_auto' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'option_loop' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'resume_playback' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'resume_time' => new external_value(PARAM_INT, '', VALUE_OPTIONAL), + 'preview_picture' => new external_value(PARAM_INT, '', VALUE_OPTIONAL), + 'show_description' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'show_title' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'show_tags' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'show_duration' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'show_viewed_duration' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), + 'columns' => new external_value(PARAM_INT, '', VALUE_OPTIONAL), + 'preventfastforwarding' => new external_value(PARAM_BOOL, '', VALUE_OPTIONAL), ]); } diff --git a/lib.php b/lib.php index 4e04208c..a5ec2996 100644 --- a/lib.php +++ b/lib.php @@ -176,12 +176,13 @@ function videotime_add_instance($moduleinstance, $mform = null) { $moduleinstance = videotime_process_video_description($moduleinstance); - $moduleinstance = [ + $moduleinstance = (array) $moduleinstance + [ 'height' => 0, 'maxheight' => 0, 'maxwidth' => 0, 'width' => 0, - ] + (array) $moduleinstance; + 'vimeo_url' => '', + ]; $moduleinstance = (object) $moduleinstance; diff --git a/plugin/live/classes/external/join_room.php b/plugin/live/classes/external/join_room.php index 79442424..792e0e86 100644 --- a/plugin/live/classes/external/join_room.php +++ b/plugin/live/classes/external/join_room.php @@ -36,7 +36,26 @@ * @copyright 2023 bdecent gmbh * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class join_room extends \block_deft\external\join_room { +class join_room extends external_api { + + /** + * Get parameter definition for raise hand + * + * @return external_function_parameters + */ + public static function execute_parameters(): external_function_parameters { + return new external_function_parameters( + [ + 'handle' => new external_value(PARAM_INT, 'Plugin handle id'), + 'id' => new external_value(PARAM_INT, 'Peer id for user session'), + 'plugin' => new external_value(PARAM_TEXT, 'Janus plugin name'), + 'ptype' => new external_value(PARAM_BOOL, 'Whether video pubisher', VALUE_DEFAULT, false), + 'room' => new external_value(PARAM_INT, 'Room id being joined'), + 'session' => new external_value(PARAM_INT, 'Janus session id'), + 'feed' => new external_value(PARAM_INT, 'Initial feed', VALUE_DEFAULT, 0), + ] + ); + } /** * Join room @@ -114,4 +133,16 @@ public static function execute($handle, $id, $plugin, $ptype, $room, $session, $ 'id' => (int) $feedid ?? 0, ]; } + + /** + * Get return definition for hand_raise + * + * @return external_single_structure + */ + public static function execute_returns(): external_single_structure { + return new external_single_structure([ + 'status' => new external_value(PARAM_BOOL, 'Whether successful'), + 'id' => new external_value(PARAM_INT, 'New video session id'), + ]); + } } diff --git a/plugin/live/classes/external/publish_feed.php b/plugin/live/classes/external/publish_feed.php index 5dece3ef..668f4c0f 100644 --- a/plugin/live/classes/external/publish_feed.php +++ b/plugin/live/classes/external/publish_feed.php @@ -34,7 +34,23 @@ * @copyright 2023 bdecent gmbh * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class publish_feed extends \block_deft\external\publish_feed { +class publish_feed extends external_api { + + /** + * Get parameter definition for raise hand + * + * @return external_function_parameters + */ + public static function execute_parameters(): external_function_parameters { + return new external_function_parameters( + [ + 'id' => new external_value(PARAM_INT, 'Peer id for user session'), + 'publish' => new external_value(PARAM_BOOL, 'Whhether to publish or not', VALUE_DEFAULT, true), + 'room' => new external_value(PARAM_INT, 'Room id being joined'), + ] + ); + } + /** * Publish feed * @@ -130,4 +146,15 @@ public static function execute($id, $publish, $room): array { 'status' => true, ]; } + + /** + * Get return definition for hand_raise + * + * @return external_single_structure + */ + public static function execute_returns(): external_single_structure { + return new external_single_structure([ + 'status' => new external_value(PARAM_BOOL, 'Whether changed'), + ]); + } } diff --git a/plugin/live/classes/external/renew_token.php b/plugin/live/classes/external/renew_token.php index a65d8d56..0292d253 100644 --- a/plugin/live/classes/external/renew_token.php +++ b/plugin/live/classes/external/renew_token.php @@ -31,7 +31,20 @@ * @copyright 2023 bdecent gmbh * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class renew_token extends \block_deft\external\renew_token { +class renew_token extends external_api { + + /** + * Get parameter definition for renew_token. + * + * @return external_function_parameters + */ + public static function execute_parameters(): external_function_parameters { + return new external_function_parameters( + [ + 'contextid' => new external_value(PARAM_INT, 'Block context id'), + ] + ); + } /** * Get new token @@ -55,4 +68,15 @@ public static function execute($contextid): array { 'token' => $token, ]; } + + /** + * Get return definition for renew_token + * + * @return external_single_structure + */ + public static function execute_returns(): external_single_structure { + return new external_single_structure([ + 'token' => new external_value(PARAM_ALPHANUM, 'Valid authentication token for deftly.us'), + ]); + } } diff --git a/plugin/live/lang/en/videotimeplugin_live.php b/plugin/live/lang/en/videotimeplugin_live.php index f2965fa7..afd8f0d6 100644 --- a/plugin/live/lang/en/videotimeplugin_live.php +++ b/plugin/live/lang/en/videotimeplugin_live.php @@ -24,11 +24,11 @@ defined('MOODLE_INTERNAL') || die(); -$string['deft:moderate'] = 'Moderate venue'; -$string['deft:sharevideo'] = 'Share video'; $string['enabledeftvideo'] = 'The Video Time live player requires the admin to install Deft response block and enable video bridging in the site settings'; +$string['live:moderate'] = 'Moderate video'; +$string['live:sharevideo'] = 'Share video'; $string['livefeed'] = 'Live feed'; $string['livefeed_help'] = 'Live feed can be supplied by a teacher'; $string['mediafile_help'] = 'Upload an audio or video file to use'; diff --git a/plugin/live/version.php b/plugin/live/version.php index 7f580630..dddd6ba5 100644 --- a/plugin/live/version.php +++ b/plugin/live/version.php @@ -25,11 +25,11 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'videotimeplugin_live'; -$plugin->release = '1.8'; -$plugin->version = 2023082000; -$plugin->requires = 2015111610; +$plugin->release = '1.8 Beta'; +$plugin->version = 2023101100; +$plugin->requires = 2023042400; $plugin->maturity = MATURITY_BETA; $plugin->dependencies = [ - 'videotime' => 2023011200, + 'videotime' => 2023101100, 'media_videojs' => 2015111600, ]; diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index 284be4ec..6729b7bd 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -4,7 +4,7 @@ amd/src/player.js Vimeo Player API MIT - v2.18.0 + v2.20.1 diff --git a/version.php b/version.php index 0534f836..3193e3bf 100644 --- a/version.php +++ b/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'mod_videotime'; -$plugin->release = '1.8'; -$plugin->version = 2023050103; +$plugin->release = '1.8 RC'; +$plugin->version = 2023101100; $plugin->requires = 2023042400; -$plugin->maturity = MATURITY_BETA; +$plugin->maturity = MATURITY_RC;