ILIAS  release_8 Revision v8.23
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

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 31 of file class.VideoSequence.php.

References ILIAS\MediaCast\Video\VideoSequence\init().

32  {
33  $this->media_cast = $cast;
34  $this->init();
35  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getFirst()

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

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

94  : ?VideoItem
95  {
96  if (count($this->videos) > 0) {
97  return $this->videos[0];
98  }
99  return null;
100  }

◆ getVideos()

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

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

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

89  : array
90  {
91  return $this->videos;
92  }

◆ init()

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

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

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

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

37  : void
38  {
39  $videos = [];
40  foreach ($this->media_cast->getSortedItemsArray() as $item) {
41  $mob = new \ilObjMediaObject($item["mob_id"]);
42  $med = $mob->getMediaItem("Standard");
43  $title = $item["title"];
44  $time = (int) $item["playtime"];
45  $preview_pic = "";
46  if ($mob->getVideoPreviewPic() != "") {
47  $preview_pic = $mob->getVideoPreviewPic();
48  }
49 
50  $mime = '';
51  $resource = '';
52 
53  if (is_object($med)) {
54  if (strcasecmp("Reference", $med->getLocationType()) == 0) {
55  $resource = $med->getLocation();
56  } else {
57  $path_to_file = \ilObjMediaObject::_getURL($mob->getId()) . "/" . $med->getLocation();
58  $resource = $path_to_file;
59  }
60  $mime = $med->getFormat();
61  }
62  if (in_array($mime, ["video/vimeo", "video/youtube"])) {
63  if (!is_int(strpos($resource, "?"))) {
64  $resource .= "?controls=0";
65  } else {
66  $resource .= "&controls=0";
67  }
68  }
69  if (in_array($mime, ["video/mp4", "video/vimeo", "video/youtube"])) {
70  $videos[] = new VideoItem(
71  $item["mob_id"],
72  $title,
73  $time,
74  $mime,
75  $resource,
76  $preview_pic,
77  (string) $item["content"],
78  (string) $item["playtime"],
79  $med->getDuration()
80  );
81  }
82  }
83  $this->videos = $videos;
84  }
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 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: