Programming Language PHP

Namespace YouTube\Utils

Class Utils

Total Examples 13

13 code examples of PHP YouTube\Utils\Utils extracted from open source projects

Was this example useful?
0
                                                    protected function query($key)
    {
        return Utils::arrayGet($this->getJson(), $key);
    }
                                            
Was this example useful?
0
                                                    public function getJson()
    {
        return Utils::parseQueryString($this->getResponseBody());
    }
                                            
Was this example useful?
0
                                                    protected function query($key)
    {
        return Utils::arrayGet($this->data, $key);
    }
                                            
Was this example useful?
0
                                                    public function getViewCount()
    {
        return Utils::arrayGet($this->videoDetails, 'viewCount');
    }
                                            
Was this example useful?
0
                                                    public function getShortDescription()
    {
        return Utils::arrayGet($this->videoDetails, 'shortDescription');
    }
                                            
Was this example useful?
0
                                                    public function getKeywords()
    {
        return Utils::arrayGet($this->videoDetails, 'keywords');
    }
                                            
Was this example useful?
0
                                                    public function getTitle()
    {
        return Utils::arrayGet($this->videoDetails, 'title');
    }
                                            
Was this example useful?
0
                                                    public function getId()
    {
        return Utils::arrayGet($this->videoDetails, 'videoId');
    }
                                            
Was this example useful?
0
                                                    protected function query($key)
    {
        return Utils::arrayGet($this->ytInitialPlayerResponse, $key);
    }
                                            
Was this example useful?
0
                                                    public function getCombinedFormats()
    {
        return Utils::arrayFilterReset($this->getAllFormats(), function ($format) {
            /** @var $format StreamFormat */
            return strpos($format->mimeType, 'video') === 0 && !empty($format->audioQuality);
        });
    }
                                            
Was this example useful?
0
                                                    public function getAudioFormats()
    {
        return Utils::arrayFilterReset($this->getAllFormats(), function ($format) {
            /** @var $format StreamFormat */
            return strpos($format->mimeType, 'audio') === 0;
        });
    }
                                            
Was this example useful?
0
                                                    // Will not include Videos with Audio
    public function getVideoFormats()
    {
        return Utils::arrayFilterReset($this->getAllFormats(), function ($format) {
            /** @var $format StreamFormat */
            return strpos($format->mimeType, 'video') === 0 && empty($format->audioQuality);
        });
    }
                                            
Was this example useful?
0
                                                    public function getUserAgent()
    {
        return Utils::arrayGet($this->headers, 'User-Agent');
    }