ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ILIAS\MediaCast\Video\VideoSequence Class Reference
+ Collaboration diagram for ILIAS\MediaCast\Video\VideoSequence:

Public Member Functions

 __construct (\ilObjMediaCast $cast)
 
 getVideos ()
 
 getFirst ()
 

Protected Member Functions

 init ()
 

Protected Attributes

ILIAS MediaObjects MediaType MediaTypeManager $media_types
 
ilObjMediaCast $media_cast
 
array $videos
 

Detailed Description

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 25 of file class.VideoSequence.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\MediaCast\Video\VideoSequence::__construct ( \ilObjMediaCast  $cast)

Definition at line 32 of file class.VideoSequence.php.

References $DIC, and ILIAS\MediaCast\Video\VideoSequence\init().

33  {
34  global $DIC;
35 
36  $this->media_types = $DIC->mediaObjects()->internal()->domain()->mediaType();
37  $this->media_cast = $cast;
38  $this->init();
39  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ getFirst()

ILIAS\MediaCast\Video\VideoSequence::getFirst ( )

Definition at line 98 of file class.VideoSequence.php.

98  : ?VideoItem
99  {
100  if (count($this->videos) > 0) {
101  return $this->videos[0];
102  }
103  return null;
104  }

◆ getVideos()

ILIAS\MediaCast\Video\VideoSequence::getVideos ( )
Returns
VideoItem[]

Definition at line 93 of file class.VideoSequence.php.

References ILIAS\MediaCast\Video\VideoSequence\$videos.

93  : array
94  {
95  return $this->videos;
96  }

◆ init()

ILIAS\MediaCast\Video\VideoSequence::init ( )
protected

Definition at line 41 of file class.VideoSequence.php.

References ILIAS\MediaCast\Video\VideoSequence\$videos, ilObjMediaObject\_getURL(), and ILIAS\Repository\int().

Referenced by ILIAS\MediaCast\Video\VideoSequence\__construct().

41  : void
42  {
43  $videos = [];
44  foreach ($this->media_cast->getSortedItemsArray() as $item) {
45  $mob = new \ilObjMediaObject($item["mob_id"]);
46  $med = $mob->getMediaItem("Standard");
47  $title = $item["title"];
48  $time = (int) $item["playtime"];
49  $preview_pic = "";
50  if ($mob->getVideoPreviewPic() != "") {
51  $preview_pic = $mob->getVideoPreviewPic();
52  }
53 
54  $mime = '';
55  $resource = '';
56 
57  if (is_object($med)) {
58  if (strcasecmp("Reference", $med->getLocationType()) == 0) {
59  $resource = $med->getLocation();
60  } else {
61  $path_to_file = \ilObjMediaObject::_getURL($mob->getId()) . "/" . $med->getLocation();
62  $resource = $path_to_file;
63  }
64  $mime = $med->getFormat();
65  }
66  if (in_array($mime, ["video/vimeo", "video/youtube"])) {
67  if (!is_int(strpos($resource, "?"))) {
68  $resource .= "?controls=0";
69  } else {
70  $resource .= "&controls=0";
71  }
72  }
73  if (in_array($mime, iterator_to_array($this->media_types->getAllowedVideoMimeTypes()), true)) {
74  $videos[] = new VideoItem(
75  $item["mob_id"],
76  $title,
77  $time,
78  $mime,
79  $resource,
80  $preview_pic,
81  (string) $item["content"],
82  (string) $item["playtime"],
83  $med->getDuration()
84  );
85  }
86  }
87  $this->videos = $videos;
88  }
static _getURL(int $a_mob_id)
get directory for files of media object
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $media_cast

ilObjMediaCast ILIAS\MediaCast\Video\VideoSequence::$media_cast
protected

Definition at line 28 of file class.VideoSequence.php.

◆ $media_types

ILIAS MediaObjects MediaType MediaTypeManager ILIAS\MediaCast\Video\VideoSequence::$media_types
protected

Definition at line 27 of file class.VideoSequence.php.

◆ $videos

array ILIAS\MediaCast\Video\VideoSequence::$videos
protected

The documentation for this class was generated from the following file: