Scan video standrad infos

@return array An array of retrieved video's infos
492853
public function getVideoInfos()
    {
        if (!$this->exists()) {
            return false;
        }
        $vid = new \finfo(FILEINFO_MIME_TYPE);
        $data = $vid->file($this->getRealPath());
        return $data;
    }
261870
public function disVideoFiles()
    {
        $properties     = $this->getProperties();
        $acceptedFiles  = $properties['acceptedFiles'];
        $vdeoExt        = $this->getVideoExtensionConstant();
        $acceptedFiles  = $this->rmAcceptedFiles($acceptedFiles, $vdeoExt);
        $properties['acceptedFiles']    = $acceptedFiles;
        $this->setProperties($properties);
        return $this;
    }
707622
public function fetchVideos()
    {
        try {
            $api_client = new Client();
            $list = $api_client->getVideosByArticles($this->HailID);
        } catch (\Exception $ex) {
            return;
        }

        $hailIdList = [];
        // CLean before importing
        $this->VideoGallery()->removeAll();

        foreach ($list as $hailData) {
            // Build up Hail ID list
            $hailIdList[] = $hailData['id'];

            // Check if we can find an existing item.
            $hailObj = Video::get()->filter(['HailID' => $hailData['id']])->First();
            if (!$hailObj) {
                $hailObj = new Video();
            }
            $hailObj->OrganisationID = $this->OrganisationID;
            $hailObj->HailOrgID = $this->HailOrgID;
            $hailObj->HailOrgName = $this->HailOrgName;

            $hailObj->importHailData($hailData);
            $this->VideoGallery()->add($hailObj);
        }
    }
332118
public function getQueuedAttachments()
    {
        $queued = [];

        foreach ($this->getMediaFiles() as $name => $attachment) {
            if ($attachment->isQueued()) {
                $queued[$name] = $attachment;
            }
        }

        return $queued;
    }
984565
public function supports($usedextensions = []) {
        $out = [];
        if ($extensions = $this->get_supported_extensions()) {
            $video = $audio = $other = [];
            foreach ($extensions as $key => $extension) {
                $displayextension = $extension;
                if (!in_array($extension, $usedextensions)) {
                    $displayextension = '<strong>'.$extension.'</strong>';
                }
                if (file_extension_in_typegroup('file.'.$extension, 'audio')) {
                    $audio[] = $displayextension;
                } else if (file_extension_in_typegroup('file.'.$extension, 'video')) {
                    $video[] = $displayextension;
                } else {
                    $other[] = $displayextension;
                }
            }
            if ($video) {
                $out[] = get_string('videoextensions', 'core_media', join(', ', $video));
            }
            if ($audio) {
                $out[] = get_string('audioextensions', 'core_media', join(', ', $audio));
            }
            if ($other) {
                $out[] = get_string('extensions', 'core_media', join(', ', $other));
            }
        }
        return join('<br>', $out);
    }
146839
protected function scanFiles($current_directory)
    {
        $files = collect(Storage::files($current_directory));
        $files = $files->filter(function ($file) {
            $ext = File::extension($file);

            if ($this->filter === 'images') {
                return in_array($ext, $this->config->get('media.images_ext'));
            } elseif ($this->filter === 'files') {
                return in_array($ext, $this->config->get('media.files_ext'));
            }

            return true;
        });

        return $files;
    }
1278054
public function video() {
		if ( isset($this->custom['video']) ) {
			return $this->custom['video'];
		}
		$video = false;

		// Only get video from the content if a playlist isn't present.
		if ( false === strpos($this->get_content(), 'wp-playlist-script') ) {
			$video = get_media_embedded_in_content($this->get_content(), array('video', 'object', 'embed', 'iframe'));
		}

		return $video;
	}
274165
private function getEpisode()
    {
        $episode = [];
        $episode_area = $this->_parser->find('.episode-video', 0);
        if ($episode_area) {
            foreach ($episode_area->find('.video-list-outer') as $v) {
                $temp = [];

                $link_area = $v->find('a', 0);
                $temp['episode'] = $this->getEpisodeTitle($link_area, 0);
                $temp['title'] = $this->getEpisodeTitle($link_area, 1);
                $temp['link'] = $link_area->href;

                $episode[] = $temp;
            }
        }

        return $episode;
    }
499719
public function getData(){
        if($this->videoItems){
            foreach($this->videoItems as $videoItem){
                $this->data['videoItems'][] = $videoItem->getData(); 
            } 
        }
        return $this->data;
    }
251077
protected function getClassesToScan()
		{
			$classes = [];

			foreach ($this->scan as $class) {
				try {
					$classes[] = new ReflectionClass($class);
				} catch (\Exception $e) {
					//
				}
			}

			return $classes;
		}
1333752
public function getVideoList($id)
    {
        $this->setId($id);

        $list = array();
        $data = $this->getData(str_replace('{key}', $this->key, $this->baseChannelUrl));

        if(!isset($data->items))
        {
            throw new \Exception("Video channel not found");
        }

        foreach($data->items as $value)
        {
            $list[] = $this->getVideoDetail($value->contentDetails->videoId);
        }

        return $list;
    }
970889
public function listLayoutAction()
    {
        $this->view->setLayoutDisabled();
        if (!$this->object || !$this->objectId || !$this->hash || !$this->t) {
            return '';
        }
        if ($this->hash != md5(\Mmi\Session\Session::getId() . '+' . $this->t . '+' . $this->objectId)) {
            return '';
        }
        $files = [];
        $thumb = new \Cms\Mvc\ViewHelper\Thumb();
        foreach (\Cms\Orm\CmsFileQuery::byObjectAndClass($this->object, $this->objectId, $this->class)->find() as $file) {
            switch ($file->class) {
                case 'image':
                    $full = $thumb->thumb($file, 'default');
                    $small = $file->getUrl('scaley', '60', false);
                    $poster = null;
                    break;
                case 'audio':
                case 'video':
                    $full = $file->getUrl();
                    $small = '';
                    $poster = $file->data->posterFileName ? (new FileSystemModel($file->data->posterFileName))->getPublicPath() : null;
                    break;
            }

            $files[] = [
                'id' => $file->id,
                'title' => $file->original,
                'full' => $full,
                'thumb' => $small,
                'poster' => $poster,
                'class' => $file->class,
                'mime' => $file->mimeType,
            ];
        }

        //przekazanie danych
        $this->view->files = $files;
    }
1302208
public function getViews() : array
    {
        $view = [];

        foreach(Finder::findFiles('*.latte')->from(self::VIEW_PATH) as $file)
        {
            /** @var \SplFileInfo $file */
            $view[] = $file->getBasename();
        }

        return $view;
    }
1153817
public function getVideoDescription()
    {
        $this->ensureMediaGroupIsNotNull();
        if ($this->getMediaGroup()->getDescription() != null) {
            return $this->getMediaGroup()->getDescription()->getText();
        } else {
            return null;
        }
    }
779580
protected function parseItemsToRemove() {
		$removals = [
			'ID' => [],
			'TAG' => [],
			'CLASS' => [],
			'TAG_CLASS' => [],
		];

		foreach ( $this->itemsToRemove as $itemToRemove ) {
			$type = '';
			$rawName = '';
			if ( $this->parseSelector( $itemToRemove, $type, $rawName ) ) {
				$removals[$type][] = $rawName;
			}
		}

		if ( $this->removeMedia ) {
			$removals['TAG'][] = 'img';
			$removals['TAG'][] = 'audio';
			$removals['TAG'][] = 'video';
		}

		return $removals;
	}
158353
public function search($params)
    {
        $query = Video::find();

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        // grid filtering conditions
        $query->andFilterWhere([
            'video_id' => $this->video_id,
            'image_id' => $this->image_id,
            'user_id' => $this->user_id,
            'orientation' => $this->orientation,
            'duration' => $this->duration,
            'on_index' => $this->on_index,
            'likes' => $this->likes,
            'dislikes' => $this->dislikes,
            'comments_num' => $this->comments_num,
            'views' => $this->views,
            'status' => $this->status,
            'published_at' => $this->published_at,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
        ]);

        $query->andFilterWhere(['like', 'slug', $this->slug])
            ->andFilterWhere(['like', 'title', $this->title])
            ->andFilterWhere(['like', 'description', $this->description])
            ->andFilterWhere(['like', 'short_description', $this->short_description])
            ->andFilterWhere(['like', 'video_url', $this->video_url])
            ->andFilterWhere(['like', 'embed', $this->embed]);

        return $dataProvider;
    }
299997
protected function getViewDataFromRequest()
    {
        $lookupParams = ['warning', 'error'];
        $result = [];
        foreach ($lookupParams as $lookupParam) {
            if ($this->getRequest()->hasParameter($lookupParam) && !empty($this->getRequest()->getParameter($lookupParam))) {
                $result[] = [
                    'level' => $lookupParam,
                    'content' => $this->getRequest()->getParameter($lookupParam),
                    'timeout' => -1
                ];
            }
        }
        return $result;
    }