Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
f7dcabd
ILMS-684 create kaltura plugin for moodle 4.5
roileviK Jan 28, 2025
5c80809
SUP-46972 move deprecated filter to text_filter - per MDL-82427
roileviK Feb 19, 2025
1a3c5cc
SUP-46972 move deprecated filter to text_filter - per MDL-82427
roileviK Feb 19, 2025
44f5384
SUP-46972 replace deprecated print_error with moodle_exception
roileviK Feb 19, 2025
0c97d9d
SUP-46972 add context_system for context_system::instance()
roileviK Feb 20, 2025
a110bbe
SUP-46972 move filter_kaltura_callback function into text_filter class
roileviK Feb 20, 2025
d413451
SUP-46972 pass callback with this
roileviK Feb 20, 2025
97e79d2
SUP-46972 use self
roileviK Feb 20, 2025
7d29597
SUP-46972 add moodle_url
roileviK Feb 20, 2025
988399f
SUP-46972 add html_writer
roileviK Feb 20, 2025
f6c823c
Merge pull request #457 from kaltura/SUP-46972-Moodle-plugins-for-4.5
roileviK Feb 20, 2025
f3e3bff
SUP-47089 bump version
roileviK Feb 20, 2025
9fa562c
Merge pull request #458 from kaltura/SUP-47089-Bump-moodle-plugin-ver…
roileviK Feb 20, 2025
e872e9b
KMS-42220 fix grade string reference - add kalvidassign component
roileviK Jul 20, 2025
2e26a8d
SUP-42220 remove deprecated grade string
roileviK Jul 20, 2025
f62d8f8
SUP-42220 use updated gradeverb and gradenoun core moodle strings
roileviK Jul 20, 2025
37d4a1d
Merge pull request #466 from kaltura/SUP-42220-Incorrect-text-appeari…
roileviK Jul 22, 2025
a60991b
SUP-42220 bump plugin version
roileviK Jul 22, 2025
afd0aab
Merge pull request #471 from kaltura/SUP-42220-bump-version-4.5
roileviK Jul 22, 2025
9fc9c47
KMS-31760 remove atto kaltura plugin - atto editor was removed from m…
roileviK Aug 3, 2025
096ffdd
KMS-31760 bump version - first kaltura plugin for moodle 5
roileviK Aug 3, 2025
9662344
Merge pull request #472 from kaltura/KMS-31760-Add-a-new-plugin-for-t…
roileviK Aug 3, 2025
09d8816
KMS-32502 add custom kaltura media submission plugin to core moodle a…
roileviK Jan 1, 2026
999d213
KMS-32502 remove .DS_Store committed by mistake
roileviK Jan 1, 2026
162eec3
KMS-32502 fix code comments
roileviK Jan 1, 2026
a565c6d
KMS-32502 fix copyright
roileviK Jan 1, 2026
4e6ec6e
KMS-32502 fix copyright
roileviK Jan 1, 2026
4bc20c4
KMS-32502 add note to legacy kaltura media assignment
roileviK Jan 1, 2026
e436bd7
KMS-32502 add note to legacy kaltura media assignment
roileviK Jan 1, 2026
78d0d5d
Merge pull request #483 from kaltura/KMS-32502-Moodle-assignment-subm…
roileviK Jan 6, 2026
eea5e5c
SUP-50260 replace jquery - fix error
roileviK Dec 11, 2025
b3b59f6
KMS-32586 add clipboard-write permission to iframes
roileviK Jan 6, 2026
3fdd717
SUP-49772 fix type error
roileviK Dec 11, 2025
04ca396
SUP-50735 add intro field files for backup/restore
roileviK Dec 21, 2025
85081e2
KMS-32838 add assignment request param to tool URL when submission is…
roileviK Jan 1, 2026
863a2bd
KMS-32838 add assignment request param to tool URL when submission is…
roileviK Jan 1, 2026
7c378e4
KMS-32811 pass guest role for anon users instead of learner by new gu…
roileviK Jan 5, 2026
2b7d647
KMS-32319 align version for 5.0
roileviK Jan 6, 2026
fba3426
Merge pull request #487 from kaltura/KMS-32319-Moodle-Plugin-5.0-Q4-2025
roileviK Jan 6, 2026
55a6d6d
KMS-32319 bump version - 5.0
roileviK Jan 6, 2026
d01d8c6
Merge pull request #489 from kaltura/KMS-32319-Moodle-v5.0-Plugin-Q4-…
roileviK Jan 6, 2026
132386f
KMS-32476 create first plugin for moodle 5.1
roileviK Jan 7, 2026
f31bc9a
SUP-52213 add local-network-access iframe allow attribute
roileviK Jun 4, 2026
64a8891
KMS-33325 add moodle plugin for version 5.2
roileviK Jun 8, 2026
a470990
KMS-33419 add repost mechanism per MDL-88721 to fix error caused by M…
roileviK Jun 9, 2026
ae62e3e
Merge pull request #512 from kaltura/KMS-33419-Moodle-SameSite-sessio…
roileviK Jun 10, 2026
3ea7883
KMS-33454 skip error on empty save, let moodle handle it
roileviK Jun 17, 2026
73b4d59
KMS-33431 add Tiny access file
roileviK Jun 11, 2026
8674956
Fix optional parameter declared before required parameter.
lucaboesch Aug 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
!local/kalturamediagallery/**/*
!local/mymedia/**/*

!lib/editor/atto/plugins/kalturamedia/**/*
!lib/editor/tinymce/plugins/kalturamedia/**/*

!createPackage.sh
Expand Down
10 changes: 5 additions & 5 deletions blocks/kalturamediagallery/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

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

$plugin->version = 2024042202;
$plugin->release = 'Kaltura release 4.5.0';
$plugin->requires = 2024042200;
$plugin->version = 2026060700;
$plugin->release = 'Kaltura release 4.5.4';
$plugin->requires = 2026042000;
$plugin->component = 'block_kalturamediagallery';
$plugin->dependencies = array(
'local_kaltura' => 2024042202,
'local_kalturamediagallery' => 2024042202
'local_kaltura' => 2026060700,
'local_kalturamediagallery' => 2026060700
);
133 changes: 70 additions & 63 deletions filter/kaltura/filter.php → filter/kaltura/classes/text_filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

namespace filter_kaltura;
use context_system;
use moodle_url;
use html_writer;

/**
* Kaltura filter script.
*
Expand All @@ -23,7 +28,7 @@
* @copyright (C) 2014 Remote-Learner.net Inc (http://www.remote-learner.net)
*/

class filter_kaltura extends moodle_text_filter {
class text_filter extends \core_filters\text_filter {
/** @var object $context The current page context. */
public static $pagecontext = null;

Expand All @@ -48,6 +53,7 @@ class filter_kaltura extends moodle_text_filter {
* @param object $page Moodle page object.
* @param object $context Page context object.
*/
#[\Override]
public function setup($page, $context) {
global $CFG;
require_once($CFG->dirroot.'/local/kaltura/locallib.php');
Expand Down Expand Up @@ -85,6 +91,66 @@ protected function get_course_context($context) {
return $coursecontext;
}

/**
* Change links to Kaltura into embedded Kaltura videos.
* @param array $link An array of elements matching the regular expression from class filter_kaltura - filter().
* @return string Kaltura embed video markup.
*/
function filter_kaltura_callback($link) {
$width = self::$defaultwidth;
$height = self::$defaultheight;
$source = '';

// Convert KAF URI anchor tags into iframe markup.
$count = count($link);
if ($count > 7) {
// Get the height and width of the iframe.
$properties = explode('||', $link[$count - 1]);

$width = $properties[2];
$height = $properties[3];

if (4 != count($properties)) {
return $link[0];
}

$source = self::$kafuri . '/browseandembed/index/media/entryid/' . $link[$count - 4] . $link[$count - 3];
}

// Convert v3 anchor tags into iframe markup.
if (7 == count($link) && $link[1] == self::$apiurl) {
$source = self::$kafuri.'/browseandembed/index/media/entryid/'.$link[4].'/playerSize/';
$source .= self::$defaultwidth.'x'.self::$defaultheight.'/playerSkin/'.$link[3];
}

$params = array(
'courseid' => self::$pagecontext->instanceid,
'height' => $height,
'width' => $width,
'withblocks' => 0,
'source' => $source

);

$url = new moodle_url('/filter/kaltura/lti_launch.php', $params);

$iframe = html_writer::tag('iframe', '', array(
'width' => $width,
'height' => $height,
'class' => 'kaltura-player-iframe',
'allowfullscreen' => 'true',
'allow' => 'autoplay *; fullscreen *; encrypted-media *; camera *; microphone *; display-capture *; clipboard-write *; local-network-access *;',
'src' => $url->out(false),
'frameborder' => '0'
));

$iframeContainer = html_writer::tag('div', $iframe, array(
'class' => 'kaltura-player-container'
));

return $iframeContainer;
}

/**
* This function does the work of converting text that matches a regular expression into
* Kaltura video markup, so that links to Kaltura videos are displayed in the Kaltura
Expand All @@ -93,6 +159,7 @@ protected function get_course_context($context) {
* @param array $options An array of additional options.
* @return string The same text or modified text is returned.
*/
#[\Override]
public function filter($text, array $options = array()) {
global $CFG;

Expand Down Expand Up @@ -120,7 +187,7 @@ public function filter($text, array $options = array()) {
$uri = str_replace(array('.', '/', 'https'), array('\.', '\/', 'https?'), $uri);

$oldsearch = '/<a\s[^>]*href="('.$uri.')\/index\.php\/kwidget\/wid\/_([0-9]+)\/uiconf_id\/([0-9]+)\/entry_id\/([\d]+_([a-z0-9]+))\/v\/flash"[^>]*>([^>]*)<\/a>/is';
$newtext = preg_replace_callback($oldsearch, 'filter_kaltura_callback', $newtext);
$newtext = preg_replace_callback($oldsearch, [$this, 'filter_kaltura_callback'], $newtext);

// Search for newer versoin of Kaltura embedded anchor tag format.
$kafuri = self::$kafuri;
Expand Down Expand Up @@ -151,7 +218,7 @@ public function filter($text, array $options = array()) {
$search .= '))\/browseandembed\/index\/media\/entryid\/([\d]+_[a-z0-9]+)(\/([a-zA-Z0-9]+\/[a-zA-Z0-9]+\/)*)"[^>]*>([^>]*)<\/a>/is';
}

$newtext = preg_replace_callback($search, 'filter_kaltura_callback', $newtext);
$newtext = preg_replace_callback($search, [$this, 'filter_kaltura_callback'], $newtext);

if (empty($newtext) || $newtext === $text) {
// Error or not filtered.
Expand All @@ -162,63 +229,3 @@ public function filter($text, array $options = array()) {
return $newtext;
}
}

/**
* Change links to Kaltura into embedded Kaltura videos.
* @param array $link An array of elements matching the regular expression from class filter_kaltura - filter().
* @return string Kaltura embed video markup.
*/
function filter_kaltura_callback($link) {
$width = filter_kaltura::$defaultwidth;
$height = filter_kaltura::$defaultheight;
$source = '';

// Convert KAF URI anchor tags into iframe markup.
$count = count($link);
if ($count > 7) {
// Get the height and width of the iframe.
$properties = explode('||', $link[$count - 1]);

$width = $properties[2];
$height = $properties[3];

if (4 != count($properties)) {
return $link[0];
}

$source = filter_kaltura::$kafuri . '/browseandembed/index/media/entryid/' . $link[$count - 4] . $link[$count - 3];
}

// Convert v3 anchor tags into iframe markup.
if (7 == count($link) && $link[1] == filter_kaltura::$apiurl) {
$source = filter_kaltura::$kafuri.'/browseandembed/index/media/entryid/'.$link[4].'/playerSize/';
$source .= filter_kaltura::$defaultwidth.'x'.filter_kaltura::$defaultheight.'/playerSkin/'.$link[3];
}

$params = array(
'courseid' => filter_kaltura::$pagecontext->instanceid,
'height' => $height,
'width' => $width,
'withblocks' => 0,
'source' => $source

);

$url = new moodle_url('/filter/kaltura/lti_launch.php', $params);

$iframe = html_writer::tag('iframe', '', array(
'width' => $width,
'height' => $height,
'class' => 'kaltura-player-iframe',
'allowfullscreen' => 'true',
'allow' => 'autoplay *; fullscreen *; encrypted-media *; camera *; microphone *; display-capture *;',
'src' => $url->out(false),
'frameborder' => '0'
));

$iframeContainer = html_writer::tag('div', $iframe, array(
'class' => 'kaltura-player-container'
));

return $iframeContainer;
}
8 changes: 4 additions & 4 deletions filter/kaltura/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
*/
defined('MOODLE_INTERNAL') || die();

$plugin->version = 2024042202; //version date YYYYMMDDXX 10 represent 3.0 for future option to moodle use 2 digit version
$plugin->version = 2026060700; //version date YYYYMMDDXX 10 represent 3.0 for future option to moodle use 2 digit version
$plugin->component = 'filter_kaltura';
$plugin->release = 'Kaltura release 4.5.0';
$plugin->requires = 2024042200;
$plugin->release = 'Kaltura release 4.5.4';
$plugin->requires = 2026042000;
$plugin->maturity = MATURITY_STABLE;
$plugin->dependencies = array(
'local_kaltura' => 2024042202
'local_kaltura' => 2026060700
);
1 change: 0 additions & 1 deletion lib/editor/atto/plugins/kalturamedia/.gitignore

This file was deleted.

20 changes: 0 additions & 20 deletions lib/editor/atto/plugins/kalturamedia/classes/privacy/provider.php

This file was deleted.

47 changes: 0 additions & 47 deletions lib/editor/atto/plugins/kalturamedia/lib.php

This file was deleted.

78 changes: 0 additions & 78 deletions lib/editor/atto/plugins/kalturamedia/ltibrowse.php

This file was deleted.

21 changes: 0 additions & 21 deletions lib/editor/atto/plugins/kalturamedia/ltibrowse_container.php

This file was deleted.

Binary file removed lib/editor/atto/plugins/kalturamedia/pix/icon.png
Binary file not shown.
Loading