ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
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.

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: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ getFirst()

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

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

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

◆ getVideos()

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

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

91 : array
92 {
93 return $this->videos;
94 }

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

◆ init()

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

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

41 : void
42 {
43 global $DIC;
44
45 $f = $DIC->ui()->factory();
46 $r = $DIC->ui()->renderer();
47
48 $videos = [];
49 foreach ($this->media_cast->getSortedItemsArray() as $item) {
50 $mob = new \ilObjMediaObject($item["mob_id"]);
51 $med = $mob->getMediaItem("Standard");
52 $title = $item["title"];
53 $time = (int) $item["playtime"];
54 $preview_pic = "";
55 if ($mob->getVideoPreviewPic() != "") {
56 $preview_pic = $mob->getVideoPreviewPic();
57 }
58
59 $mime = '';
60 $resource = '';
61 $local = false;
62 if (is_object($med)) {
63 $resource = $mob->getStandardSrc();
64 if ($med->getLocationType() !== "Reference") {
65 $local = true;
66 }
67 $mime = $med->getFormat();
68 }
69 if (in_array($mime, iterator_to_array($this->media_types->getAllowedVideoMimeTypes()), true)) {
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 $local,
81 $item["id"]
82 );
83 }
84 }
85 $this->videos = $videos;
86 }

References $DIC, Vendor\Package\$f, ILIAS\MediaCast\Video\VideoSequence\$videos, and ILIAS\Repository\int().

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

+ 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: