Skip to content

Commit

Permalink
VID-656: Add live player
Browse files Browse the repository at this point in the history
  • Loading branch information
dthies committed Aug 1, 2023
1 parent f720c60 commit 9ec7d14
Show file tree
Hide file tree
Showing 35 changed files with 2,681 additions and 14 deletions.
7 changes: 6 additions & 1 deletion classes/videotime_instance.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

namespace mod_videotime;

use cm_info;
use core_component;
use external_description;
use mod_videotime\local\tabs\tabs;
Expand Down Expand Up @@ -64,7 +65,7 @@ class videotime_instance implements \renderable, \templatable {
/**
* Temporary storage for course module. Use $this->get_cm() instead.
*
* @var \stdClass|null
* @var cm_info|null
*/
private $cm = null;

Expand Down Expand Up @@ -565,6 +566,10 @@ public static function get_external_description(): external_description {
* Call plugins hook to setup page
*/
public function setup_page() {
foreach (array_keys(core_component::get_plugin_list('videotimeplugin')) as $name) {
component_callback("videotimeplugin_$name", 'setup_page', [$this->to_record(), $this->get_cm()]);
}

if ($this->enabletabs) {
$this->tabs->setup_page();
}
Expand Down
4 changes: 3 additions & 1 deletion classes/vimeo_embed.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
*/
class vimeo_embed implements \renderable, \templatable {

protected $cm = null;

/**
* Constructor
*
Expand All @@ -61,7 +63,7 @@ public function __construct(\stdClass $instancerecord) {
*/
public function get_cm() {
if (is_null($this->cm)) {
$this->cm = get_coursemodule_from_instance('videotime', $this->id);
$this->cm = get_coursemodule_from_instance('videotime', $this->record->id);
}
return $this->cm;
}
Expand Down
4 changes: 4 additions & 0 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ function videotime_update_instance($moduleinstance, $mform = null) {
$classname::save_settings($moduleinstance);
}

if (!empty($mform) && !empty($mform->get_data()->livefeed)) {
$moduleinstance->vimeo_url = '';
}

return $DB->update_record('videotime', $moduleinstance);
}

Expand Down
3 changes: 3 additions & 0 deletions plugin/live/amd/build/socket.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions plugin/live/amd/build/socket.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions plugin/live/amd/build/videotime.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions plugin/live/amd/build/videotime.min.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 9ec7d14

Please sign in to comment.