This commit is contained in:
Markos Gogoulos
2026-02-01 16:53:21 +02:00
parent 8e7f1ef15d
commit 1c0805748d
3 changed files with 18 additions and 2 deletions

View File

@@ -1 +1 @@
VERSION = "8.09"
VERSION = "8.10"

View File

@@ -212,6 +212,22 @@ export class ProfileMediaPage extends Page {
if (isSelected) {
newSelectedMedia.add(mediaId);
console.log('Selected media item:', mediaId);
// Send postMessage to parent window (Moodle TinyMCE plugin)
if (window.parent !== window) {
// Construct the embed URL
const baseUrl = window.location.origin;
const embedUrl = `${baseUrl}/embed?m=${mediaId}`;
// Send message in the format expected by the Moodle plugin
window.parent.postMessage({
type: 'videoSelected',
embedUrl: embedUrl,
videoId: mediaId
}, '*');
console.log('Sent postMessage to parent:', { embedUrl, videoId: mediaId });
}
}
} else {
// Normal mode: allow multiple selection

File diff suppressed because one or more lines are too long