Skip to content
This repository was archived by the owner on Feb 25, 2024. It is now read-only.

Commit bc20ceb

Browse files
author
Theodor Truffer
committed
moved high-/lowres to "internal video player" config, adjusted langvars
1 parent e91865a commit bc20ceb

File tree

5 files changed

+44
-28
lines changed

5 files changed

+44
-28
lines changed

classes/Conf/class.xoctConfFormGUI.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ protected function initEventsSection() {
231231
$this->addItem($cb);
232232

233233

234+
// INTERNAL VIDEO PLAYER
234235
$cb = new ilCheckboxInputGUI($this->parent_gui->txt(xoctConf::F_INTERNAL_VIDEO_PLAYER), xoctConf::F_INTERNAL_VIDEO_PLAYER);
235236
$cb->setInfo($this->parent_gui->txt(xoctConf::F_INTERNAL_VIDEO_PLAYER . '_info'));
236237
$this->addItem($cb);
@@ -245,6 +246,11 @@ protected function initEventsSection() {
245246
$te->setRequired(true);
246247
$cbs->addSubItem($te);
247248

249+
$cbs = new ilCheckboxInputGUI($this->parent_gui->txt(xoctConf::F_USE_HIGHLOWRESSEGMENTPREVIEWS), xoctConf::F_USE_HIGHLOWRESSEGMENTPREVIEWS);
250+
$cbs->setInfo($this->parent_gui->txt(xoctConf::F_USE_HIGHLOWRESSEGMENTPREVIEWS . '_info'));
251+
$cbs->setRequired(false);
252+
$cb->addSubItem($cbs);
253+
248254

249255
$cb = new ilCheckboxInputGUI($this->parent_gui->txt(xoctConf::F_USE_MODALS), xoctConf::F_USE_MODALS);
250256
$cb->setInfo($this->parent_gui->txt(xoctConf::F_USE_MODALS . '_info'));
@@ -304,13 +310,6 @@ protected function initEventsSection() {
304310
$ro = new ilRadioOption($this->parent_gui->txt(xoctConf::F_SCHEDULED_METADATA_EDITABLE . '_' . xoctConf::METADATA_EXCEPT_DATE_PLACE), xoctConf::METADATA_EXCEPT_DATE_PLACE);
305311
$ri->addOption($ro);
306312
$this->addItem($ri);
307-
308-
309-
$cb = new ilCheckboxInputGUI($this->parent_gui->txt(xoctConf::F_USE_HIGHLOWRESSEGMENTPREVIEWS), xoctConf::F_USE_HIGHLOWRESSEGMENTPREVIEWS);
310-
$cb->setInfo($this->parent_gui->txt(xoctConf::F_USE_HIGHLOWRESSEGMENTPREVIEWS . '_info'));
311-
$cb->setRequired(false);
312-
$this->addItem($cb);
313-
314313
}
315314

316315

classes/Event/class.xoctEvent.php

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ public function getThumbnailUrl() {
555555
);
556556
$i = 0;
557557
while (!$this->thumbnail_url && $i < count($possible_publications)) {
558-
$url = $this->getPublicationMetadataForUsage(xoctPublicationUsage::find($possible_publications[$i]))->getUrl();
558+
$url = $this->getFirstPublicationMetadataForUsage(xoctPublicationUsage::find($possible_publications[$i]))->getUrl();
559559
if (xoctConf::getConfig(xoctConf::F_SIGN_THUMBNAIL_LINKS)) {
560560
$this->thumbnail_url = xoctSecureLink::sign($url);
561561
} else {
@@ -576,7 +576,7 @@ public function getThumbnailUrl() {
576576
*/
577577
public function getAnnotationLink() {
578578
if (!isset($this->annotation_url)) {
579-
$url = $this->getPublicationMetadataForUsage(xoctPublicationUsage::find(xoctPublicationUsage::USAGE_ANNOTATE))->getUrl();
579+
$url = $this->getFirstPublicationMetadataForUsage(xoctPublicationUsage::find(xoctPublicationUsage::USAGE_ANNOTATE))->getUrl();
580580
if (xoctConf::getConfig(xoctConf::F_SIGN_ANNOTATION_LINKS)) {
581581
$this->annotation_url = xoctSecureLink::sign($url);
582582
} else {
@@ -594,7 +594,7 @@ public function getAnnotationLink() {
594594
*/
595595
public function getPlayerLink() {
596596
if (!isset($this->player_url)) {
597-
$url = $this->getPublicationMetadataForUsage(xoctPublicationUsage::find(xoctPublicationUsage::USAGE_PLAYER))->getUrl();
597+
$url = $this->getFirstPublicationMetadataForUsage(xoctPublicationUsage::find(xoctPublicationUsage::USAGE_PLAYER))->getUrl();
598598
if (xoctConf::getConfig(xoctConf::F_SIGN_PLAYER_LINKS)) {
599599
$this->player_url = xoctSecureLink::sign($url);
600600
} else {
@@ -611,7 +611,7 @@ public function getPlayerLink() {
611611
*/
612612
public function getDownloadLink() {
613613
if (!isset($this->download_url)) {
614-
$url = $this->getPublicationMetadataForUsage(xoctPublicationUsage::find(xoctPublicationUsage::USAGE_DOWNLOAD))->getUrl();
614+
$url = $this->getFirstPublicationMetadataForUsage(xoctPublicationUsage::find(xoctPublicationUsage::USAGE_DOWNLOAD))->getUrl();
615615
if (xoctConf::getConfig(xoctConf::F_SIGN_DOWNLOAD_LINKS)) {
616616
$this->download_url = xoctSecureLink::sign($url);
617617
} else {
@@ -630,7 +630,7 @@ public function getCuttingLink() {
630630
if (!isset($this->cutting_url)) {
631631
$url = str_replace('{event_id}', $this->getIdentifier(), xoctConf::getConfig(xoctConf::F_EDITOR_LINK));
632632
if (!$url) {
633-
$url = $this->getPublicationMetadataForUsage(xoctPublicationUsage::find(xoctPublicationUsage::USAGE_CUTTING))->getUrl();
633+
$url = $this->getFirstPublicationMetadataForUsage(xoctPublicationUsage::find(xoctPublicationUsage::USAGE_CUTTING))->getUrl();
634634
}
635635
if (!$url) {
636636
$base = rtrim(xoctConf::getConfig(xoctConf::F_API_BASE), "/");
@@ -648,50 +648,63 @@ public function getCuttingLink() {
648648
/**
649649
* @param $xoctPublicationUsage
650650
*
651-
* @return xoctPublication
651+
* @return array
652652
*/
653653
public function getPublicationMetadataForUsage($xoctPublicationUsage) {
654654
if (!$xoctPublicationUsage instanceof xoctPublicationUsage) {
655-
return new xoctPublication();
655+
return [new xoctPublication()];
656656
}
657657
/**
658658
* @var $xoctPublicationUsage xoctPublicationUsage
659659
* @var $attachment xoctAttachment
660660
* @var $media xoctMedia
661661
*/
662-
$medias = array();
663-
$attachments = array();
662+
$medias = [];
663+
$attachments = [];
664664
foreach ($this->getPublications() as $publication) {
665665
if ($publication->getChannel() == $xoctPublicationUsage->getChannel()) {
666666
$medias = array_merge($medias, $publication->getMedia());
667667
$attachments = array_merge($attachments, $publication->getAttachments());
668668
}
669669
}
670+
$return = [];
670671
switch ($xoctPublicationUsage->getMdType()) {
671672
case xoctPublicationUsage::MD_TYPE_ATTACHMENT:
672673
foreach ($attachments as $attachment) {
673674
if ($attachment->getFlavor() == $xoctPublicationUsage->getFlavor()) {
674-
return $attachment;
675+
$return[] = $attachment;
675676
}
676677
}
677678
break;
678679
case xoctPublicationUsage::MD_TYPE_MEDIA:
679680
foreach ($medias as $media) {
680681
if ($media->getFlavor() == $xoctPublicationUsage->getFlavor()) {
681-
return $media;
682+
$return[] = $media;
682683
}
683684
}
684685
break;
685686
case xoctPublicationUsage::MD_TYPE_PUBLICATION_ITSELF:
686687
foreach ($this->getPublications() as $publication) {
687688
if ($publication->getChannel() == $xoctPublicationUsage->getChannel()) {
688-
return $publication;
689+
$return[] = $publication;
689690
}
690691
}
691692
break;
693+
default:
694+
return [new xoctPublication()];
692695
}
696+
return $return;
697+
}
698+
693699

694-
return new xoctPublication();
700+
/**
701+
* @param $xoctPublicationUsage
702+
*
703+
* @return mixed|xoctPublication
704+
*/
705+
public function getFirstPublicationMetadataForUsage($xoctPublicationUsage) {
706+
$metadata = $this->getPublicationMetadataForUsage($xoctPublicationUsage);
707+
return count($metadata) ? array_shift($metadata) : new xoctPublication();
695708
}
696709

697710

classes/Event/class.xoctEventGUI.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ public function streamVideo() {
453453
$this->cancel();
454454
}
455455

456-
$publication_player = $xoctEvent->getPublicationMetadataForUsage(xoctPublicationUsage::getUsage(xoctPublicationUsage::USAGE_PLAYER));
456+
$publication_player = $xoctEvent->getFirstPublicationMetadataForUsage(xoctPublicationUsage::getUsage(xoctPublicationUsage::USAGE_PLAYER));
457457

458458
// Multi stream
459459
$medias = array_values(array_filter($publication_player->getMedia(), function (xoctMedia $media) {
@@ -567,9 +567,13 @@ public function streamVideo() {
567567
}, $medias);
568568

569569
$segmentFlavor = xoctPublicationUsage::find(xoctPublicationUsage::USAGE_SEGMENTS)->getFlavor();
570-
$publication_segments = $xoctEvent->getPublicationMetadataForUsage(xoctPublicationUsage::getUsage(xoctPublicationUsage::USAGE_SEGMENTS));
570+
$publication_usage_segments = xoctPublicationUsage::getUsage(xoctPublicationUsage::USAGE_SEGMENTS);
571+
$attachments =
572+
$publication_usage_segments->getMdType() == xoctPublicationUsage::MD_TYPE_PUBLICATION_ITSELF ?
573+
$xoctEvent->getFirstPublicationMetadataForUsage($publication_usage_segments)->getAttachments() :
574+
$xoctEvent->getPublicationMetadataForUsage($publication_usage_segments);
571575

572-
$segments = array_filter($publication_segments->getAttachments(), function (xoctAttachment $attachment) use ( &$segmentFlavor) {
576+
$segments = array_filter($attachments, function (xoctAttachment $attachment) use ( &$segmentFlavor) {
573577
return strpos($attachment->getFlavor(), $segmentFlavor) !== FALSE;
574578
});
575579

@@ -672,7 +676,7 @@ protected function deliverVideo() {
672676
$event_id = $_GET['event_id'];
673677
$mid = $_GET['mid'];
674678
$xoctEvent = xoctEvent::find($event_id);
675-
$media = $xoctEvent->getPublicationMetadataForUsage(xoctPublicationUsage::getUsage(xoctPublicationUsage::USAGE_PLAYER))->getMedia();
679+
$media = $xoctEvent->getFirstPublicationMetadataForUsage(xoctPublicationUsage::getUsage(xoctPublicationUsage::USAGE_PLAYER))->getMedia();
676680
foreach ($media as $medium) {
677681
if ($medium->getId() == $mid) {
678682
$url = $medium->getUrl();

lang/ilias_de.lang

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ config_scheduled_metadata_editable_2#:#Alle, außer Datum und Aufnahmestation
104104
config_segment_tag#:#Segment-preview-Tag
105105
config_segment_tag_info#:#Benutze den Tag für das Filtern der Segment-Previews
106106
config_use_highlowres_segment_preview#:#High- und Low-Resolution Previews nutzen.
107-
config_use_highlowres_segment_preview_info#:#(Kein Opencast-Default-Verhalten, muss konfiguriert sein)
107+
config_use_highlowres_segment_preview_info#:#Standardmässig in Opencast deaktiviert, muss konfiguriert werden.
108108
config_video_portal_title#:#Bezeichung des externen Videoportals
109109
config_video_portal_link#:#Link zu externem Videoportal
110110
config_video_portal_link_info#:#Wird in den Einstellungen und im Infotab einer Serie angezeigt. Als Platzhalter kann &#123series_id} verwendet werden. Bsp: https://myopencast-tube.com/cast/channels/&#123series_id}
@@ -237,7 +237,7 @@ publication_usage_title#:#Titel
237237
publication_usage_type_annotate#:#Annotationen
238238
publication_usage_type_api#:#API
239239
publication_usage_type_cutting#:#Cutting-Tool
240-
publication_usage_type_segments#:#Segments Preview Flavor
240+
publication_usage_type_segments#:#Segments
241241
publication_usage_type_player#:#Player
242242
publication_usage_type_thumbnail#:#Vorschaubild
243243
publication_usage_update#:#Aktualisieren

lang/ilias_en.lang

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ config_scheduled_metadata_editable_2#:#All, except date and recording station.
104104
config_segment_tag#:#Segment-preview-Tag
105105
config_segment_tag_info#:#Use Tag for filtering the segment-previews
106106
config_use_highlowres_segment_preview#:#High- and low-resolution previews.
107-
config_use_highlowres_segment_preview_info#:#(No Opencast-default-Behaviour)
107+
config_use_highlowres_segment_preview_info#:#Deactivated by default, must be configured in Opencast
108108
config_video_portal_title#:#Title of external Video Portal
109109
config_video_portal_link#:#Link to external Video Portal
110110
config_video_portal_link_info#:#Will be displayed in the settings and info tab of a series. &#123series_id} can be used as a placeholder. E.g.: https://myopencast-tube.com/cast/channels/&#123series_id}
@@ -239,7 +239,7 @@ publication_usage_title#:#Title
239239
publication_usage_type_annotate#:#Annotate
240240
publication_usage_type_api#:#API
241241
publication_usage_type_cutting#:#Cutting-Tool
242-
publication_usage_type_segments#:#Segments Preview Flavor
242+
publication_usage_type_segments#:#Segments Preview
243243
publication_usage_type_player#:#Player
244244
publication_usage_type_thumbnail#:#Thumbnail
245245
publication_usage_update#:#Update

0 commit comments

Comments
 (0)