public function getLiveStreams($channel = null, $game = null, $language = null, $streamType = 'live', $limit = 25, $offset = 0, $broadcaster_language = null)
    {
        if ($channel) {
            if (!is_string($channel)) {
                throw new InvalidTypeException('channel', 'string', gettype($channel));
            }

            $channel = trim($channel, ', ');
            if ($this->apiVersionIsGreaterThanV3()) {
                foreach (explode(',', $channel) as $chan) {
                    if (!is_numeric($chan)) {
                        throw new InvalidIdentifierException('channel');
                    }
                }
            }
        }

        if ($game && !is_string($game)) {
            throw new InvalidTypeException('game', 'string', gettype($game));
        }

        if ($language && !is_string($language)) {
            throw new InvalidTypeException('language', 'string', gettype($language));
        }

        if ($broadcaster_language && !is_string($broadcaster_language)) {
            throw new InvalidTypeException('broadcaster_language', 'string', gettype($broadcaster_language));
        }

        if (!$this->isValidStreamType($streamType)) {
            throw new InvalidStreamTypeException();
        }

        if (!$this->isValidLimit($limit)) {
            throw new InvalidLimitException();
        }

        if (!$this->isValidOffset($offset)) {
            throw new InvalidOffsetException();
        }

        $params = [
            'channel' => $channel,
            'game' => $game,
            'language' => $language,
            'broadcaster_language' => $broadcaster_language,
            'stream_type' => $streamType,
            'limit' => intval($limit),
            'offset' => intval($offset),
        ];

        return $this->get('streams', $params);
    }
public function getLiveStreams($channel = null, $game = null, $language = null, $streamType = 'live', $limit = 25, $offset = 0, $broadcaster_language = null)
    {
        if ($channel) {
            if (!is_string($channel)) {
                throw new InvalidTypeException('channel', 'string', gettype($channel));
            }

            $channel = trim($channel, ', ');
            if ($this->apiVersionIsGreaterThanV3()) {
                foreach (explode(',', $channel) as $chan) {
                    if (!is_numeric($chan)) {
                        throw new InvalidIdentifierException('channel');
                    }
                }
            }
        }

        if ($game && !is_string($game)) {
            throw new InvalidTypeException('game', 'string', gettype($game));
        }

        if ($language && !is_string($language)) {
            throw new InvalidTypeException('language', 'string', gettype($language));
        }

        if ($broadcaster_language && !is_string($broadcaster_language)) {
            throw new InvalidTypeException('broadcaster_language', 'string', gettype($broadcaster_language));
        }

        if (!$this->isValidStreamType($streamType)) {
            throw new InvalidStreamTypeException();
        }

        if (!$this->isValidLimit($limit)) {
            throw new InvalidLimitException();
        }

        if (!$this->isValidOffset($offset)) {
            throw new InvalidOffsetException();
        }

        $params = [
            'channel' => $channel,
            'game' => $game,
            'language' => $language,
            'broadcaster_language' => $broadcaster_language,
            'stream_type' => $streamType,
            'limit' => intval($limit),
            'offset' => intval($offset),
        ];

        return $this->get('streams', $params);
    }
public function getLiveStreams ( $ channel = null , $ game = null , $ language = null , $ streamType = 'live' , $ limit = 25 , $ offset = 0 , $ broadcaster_language = null ) { if ( $ channel ) { if ( ! is_string ( $ channel ) ) { throw new InvalidTypeException ( 'channel' , 'string' , gettype ( $ channel ) ) ; } $ channel = trim ( $ channel , ', ' ) ; if ( $ this -> apiVersionIsGreaterThanV3 ( ) ) { foreach ( explode ( ',' , $ channel ) as $ chan ) { if ( ! is_numeric ( $ chan ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } } } } if ( $ game && ! is_string ( $ game ) ) { throw new InvalidTypeException ( 'game' , 'string' , gettype ( $ game ) ) ; } if ( $ language && ! is_string ( $ language ) ) { throw new InvalidTypeException ( 'language' , 'string' , gettype ( $ language ) ) ; } if ( $ broadcaster_language && ! is_string ( $ broadcaster_language ) ) { throw new InvalidTypeException ( 'broadcaster_language' , 'string' , gettype ( $ broadcaster_language ) ) ; } if ( ! $ this -> isValidStreamType ( $ streamType ) ) { throw new InvalidStreamTypeException ( ) ; } if ( ! $ this -> isValidLimit ( $ limit ) ) { throw new InvalidLimitException ( ) ; } if ( ! $ this -> isValidOffset ( $ offset ) ) { throw new InvalidOffsetException ( ) ; } $ params = [ 'channel' => $ channel , 'game' => $ game , 'language' => $ language , 'broadcaster_language' => $ broadcaster_language , 'stream_type' => $ streamType , 'limit' => intval ( $ limit ) , 'offset' => intval ( $ offset ) , ] ; return $ this -> get ( 'streams' , $ params ) ; }
Get live streams

@param string $channel (comma-seperated list)
@param string $game
@param string $language
@param string $streamType
@param int    $limit
@param int    $offset
@param string $broadcaster_language
@throws InvalidTypeException
@throws InvalidIdentifierException
@throws InvalidStreamTypeException
@throws InvalidLimitException
@throws InvalidOffsetException
@return array|json
Get live streams