ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 91 of file class.VideoSequence.php.

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

◆ getVideos()

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

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

86 : array
87 {
88 return $this->videos;
89 }

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
62 if (is_object($med)) {
63 $resource = $mob->getStandardSrc();
64 $mime = $med->getFormat();
65 }
66 if (in_array($mime, iterator_to_array($this->media_types->getAllowedVideoMimeTypes()), true)) {
67 $videos[] = new VideoItem(
68 $item["mob_id"],
69 $title,
70 $time,
71 $mime,
72 $resource,
73 $preview_pic,
74 (string) $item["content"],
75 (string) $item["playtime"],
76 $med->getDuration()
77 );
78 }
79 }
80 $this->videos = $videos;
81 }

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: