Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 6 additions & 4 deletions classes/GUI/Abstract/class.xvmpGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
use srag\Plugins\ViMP\Content\MediumMetadataDTOBuilder;
use srag\Plugins\ViMP\UIComponents\Renderer\Factory;
use srag\Plugins\ViMP\UIComponents\Player\VideoPlayer;
use ILIAS\StaticURL\Services;
use ILIAS\Data\ReferenceId;

/**
* Class xvmpGUI
Expand Down Expand Up @@ -306,11 +308,11 @@ public function getObject() : ?ilObject
public function buildPermLinkUI(xvmpMedium $video) : array
{
$items = [];
$link_tpl = ilLink::_getStaticLink(
$this->parent_gui->getRefId(),

$link_tpl = $this->dic['static_url']->builder()->build(
$this->parent_gui->getType(),
true,
'_' . $video->getMid() . '_0'
new ReferenceId($this->parent_gui->getRefId()),
[$video->getMid() , '0']
);

$popover = $this->dic->ui()->factory()->popover()->standard(
Expand Down
12 changes: 8 additions & 4 deletions classes/class.ilObjViMPGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,16 @@ public static function _goto($a_target) : void

$DIC->ctrl()->setParameterByClass(xvmpContentGUI::class, self::GET_REF_ID, $id[0]);

if (isset($id[1])) {
if (isset($id[3])) {
if (isset($id[0])) {
if (isset($id[2])) {
// time
$DIC->ctrl()->setParameterByClass(xvmpContentGUI::class, self::GET_TIME, (int) $id[3]);
$DIC->ctrl()->setParameterByClass(xvmpContentGUI::class, self::GET_TIME, (int) $id[2]);
}
$DIC->ctrl()->setParameterByClass(xvmpContentGUI::class, self::GET_VIDEO_ID, (int) $id[2]);

if(isset($id[1])){
$DIC->ctrl()->setParameterByClass(xvmpContentGUI::class, self::GET_VIDEO_ID, (int) $id[1]);
}

$DIC->ctrl()->redirectByClass(
[ilObjPluginDispatchGUI::class, self::class, xvmpContentGUI::class],
xvmpContentGUI::CMD_PLAY_VIDEO
Expand Down
18 changes: 16 additions & 2 deletions src/UIComponents/Player/VideoPlayer.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,23 @@ public function getHTML(): string
if ($medium && xvmp::ViMPVersionGreaterEquals('4.1.0') && $abr_conf) {
$isABRStream = true;
$medium = html_entity_decode($medium);
//$medium = str_replace('mp4', 'smil', $medium);
//$medium = preg_replace('/(_[0-9]{3,4}p)?\.smil/', '.smil', $medium);
$medium = str_replace('mp4', 'smil', $medium);
$medium = preg_replace('/(_[0-9]{3,4}p)?\.smil/', '.smil', $medium);
}

if (xvmp::ViMPVersionGreaterEquals('6.2.0')) {
$medium_newer = $this->video->getField('streaming');
foreach ($medium_newer as $playlist) {
if(str_contains($playlist, '<ip-address>')){
continue;
}
if (str_contains($playlist, 'smil:')){
$medium = $playlist;
break;
}
}
}

$random = new ilRandom();
$id = md5(((string) ($random->int(1, 9999999) + str_replace(" ", "", (string) microtime()))));

Expand Down
4 changes: 2 additions & 2 deletions templates/js/xvmp_content.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ var VimpContent = {

copyDirectLinkWithTime: function (link_tpl) {
let player_instance = videojs.getPlayers();
let currentTime = '_' + Math.floor(Object.values(player_instance)[0].currentTime());
let link = link_tpl.replace('_0', currentTime).replace('_0&', currentTime + '&');
let currentTime = '/' + Math.floor(Object.values(player_instance)[0].currentTime());
let link = link_tpl.replace('/0', currentTime);
this.copyToClipboard(link);
},

Expand Down