3 declare(strict_types=1);
    29     protected \ILIAS\MediaObjects\Tracking\TrackingManager 
$tracking;
    30     protected \ILIAS\MediaObjects\Player\PlayerGUIRequest 
$request;
    31     protected \ILIAS\MediaObjects\MediaType\MediaTypeManager 
$media_type;
    39         $this->gui = $gui_service;
    40         $this->domain = $domain_service;
    41         $this->media_type = $this->domain->
mediaType();
    42         $this->request = $gui_service->
player()->request();
    43         $this->tracking = $this->domain->tracking();
    48         $ctrl = $this->gui->ctrl();
    50         $next_class = $ctrl->getNextClass($this);
    51         $cmd = $ctrl->getCmd();
    53         switch ($next_class) {
    55                 if (in_array($cmd, array(
"saveCompletion"))) {
    63         int $tracking_container_ref_id = 0) : string
    65         $comp = $this->
getComponent($mob, $tracking_container_ref_id);
    67             return $this->gui->ui()->renderer()->render($comp);
    78             if ($this->media_type->isAudio($med->getFormat())) {
    81                     $tracking_container_ref_id
    83             } elseif ($this->media_type->isVideo($med->getFormat())) {
    86                     $tracking_container_ref_id
    88             } elseif ($this->media_type->isImage($med->getFormat())) {
    91                     $tracking_container_ref_id
   103         int $tracking_container_ref_id = 0
   105         $main_tpl = $this->gui->ui()->mainTemplate();
   107         $ctrl = $this->gui->ctrl();
   111         if (is_null($med) || !$this->media_type->isAudio($med->getFormat())) {
   115         $audio = $this->gui->ui()->factory()->player()->audio(
   120         if ($tracking_container_ref_id > 0) {
   123             $treshold = (
int) $mcst_settings->getVideoCompletionThreshold();
   125             $main_tpl->addJavaScript(
"assets/js/MediaObjectsCompletion.js");
   126             $ctrl->setParameter($this, 
"mob_tracking_ref_id", $tracking_container_ref_id);
   127             $ctrl->setParameter($this, 
"mob_tracking_mob_id", $mob->
getId());
   128             $url = $ctrl->getLinkTarget($this, 
"saveCompletion");
   129             $audio = $audio->withAdditionalOnLoadCode(
function (
$id) use (
$url, $treshold) {
   131                 document.getElementById(
'$id').dataset.mobCompletionCallback = 
'$url';
   132                 document.getElementById(
'$id').dataset.mobCompletionThreshold = 
'$treshold';
   133                 il.MediaObjectsCompletion.init();
   146         int $tracking_container_ref_id = 0
   148         $main_tpl = $this->gui->ui()->mainTemplate();
   150         $ctrl = $this->gui->ctrl();
   154         if (is_null($med) || !$this->media_type->isImage($med->getFormat())) {
   160         $image = $this->gui->ui()->factory()->image()->responsive($source, $mob->
getTitle());
   162         if ($tracking_container_ref_id > 0) {
   165             $treshold = (
int) $mcst_settings->getVideoCompletionThreshold();
   167             $main_tpl->addJavaScript(
"assets/js/MediaObjectsCompletion.js");
   168             $ctrl->setParameter($this, 
"mob_tracking_ref_id", $tracking_container_ref_id);
   169             $ctrl->setParameter($this, 
"mob_tracking_mob_id", $mob->
getId());
   170             $url = $ctrl->getLinkTarget($this, 
"saveCompletion");
   171             $audio = $image->withAdditionalOnLoadCode(
function (
$id) use (
$url, $treshold) {
   173                 document.getElementById(
'$id').dataset.mobCompletionCallback = 
'$url';
   174                 document.getElementById(
'$id').dataset.mobCompletionThreshold = 
'$treshold';
   175                 il.MediaObjectsCompletion.init();
   188         int $tracking_container_ref_id = 0
   190         $main_tpl = $this->gui->ui()->mainTemplate();
   192         $ctrl = $this->gui->ctrl();
   196         if (is_null($med) || !$this->media_type->isVideo($med->getFormat())) {
   202         $video = $this->gui->ui()->factory()->player()->video(
   207         if ($tracking_container_ref_id > 0) {
   210             $treshold = (
int) $mcst_settings->getVideoCompletionThreshold();
   212             $main_tpl->addJavaScript(
"assets/js/MediaObjectsCompletion.js");
   213             $ctrl->setParameter($this, 
"mob_tracking_ref_id", $tracking_container_ref_id);
   214             $ctrl->setParameter($this, 
"mob_tracking_mob_id", $mob->
getId());
   215             $url = $ctrl->getLinkTarget($this, 
"saveCompletion");
   216             $audio = $video->withAdditionalOnLoadCode(
function (
$id) use (
$url, $treshold) {
   218                 document.getElementById(
'$id').dataset.mobCompletionCallback = 
'$url';
   219                 document.getElementById(
'$id').dataset.mobCompletionThreshold = 
'$treshold';
   220                 il.MediaObjectsCompletion.init();
   230         $ref_id = $this->request->getTrackingRefId();
   231         $mob_id = $this->request->getTrackingMobId();
   232         $this->tracking->saveCompletion($mob_id, 
$ref_id);
 
Interface Observer  Contains several chained tasks and infos about them. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins