public function fetchPermanentVideo ($mediaID, $into = null)
    {
        $stream = $this->doPermanentFetchToStream($mediaID, null);
        $json = json_decode(stream_get_contents($stream));

        $body = $this->client->send(
            new Request(
                'GET',
                $json->down_url
            ),
            [
                RequestOptions::SINK => $this->createWritableStream($into),
            ]
        )->getBody();
        if ($body->isSeekable()) {
            $body->seek(0);
        }

        return (new Downloaded\Video($mediaID, $body->detach()))
            ->withTitle($json->title)
            ->withDescription($json->description);
    }
public function fetchPermanentVideo ($mediaID, $into = null)
    {
        $stream = $this->doPermanentFetchToStream($mediaID, null);
        $json = json_decode(stream_get_contents($stream));

        $body = $this->client->send(
            new Request(
                'GET',
                $json->down_url
            ),
            [
                RequestOptions::SINK => $this->createWritableStream($into),
            ]
        )->getBody();
        if ($body->isSeekable()) {
            $body->seek(0);
        }

        return (new Downloaded\Video($mediaID, $body->detach()))
            ->withTitle($json->title)
            ->withDescription($json->description);
    }
public function fetchPermanentVideo ( $ mediaID , $ into = null ) { $ stream = $ this -> doPermanentFetchToStream ( $ mediaID , null ) ; $ json = json_decode ( stream_get_contents ( $ stream ) ) ; $ body = $ this -> client -> send ( new Request ( 'GET' , $ json -> down_url ) , [ RequestOptions :: SINK => $ this -> createWritableStream ( $ into ) , ] ) -> getBody ( ) ; if ( $ body -> isSeekable ( ) ) { $ body -> seek ( 0 ) ; } return ( new Downloaded \ Video ( $ mediaID , $ body -> detach ( ) ) ) -> withTitle ( $ json -> title ) -> withDescription ( $ json -> description ) ; }
Downloads the given video into the specified file.

@param string               $mediaID
@param null|string|resource $into

@return Downloaded\Video
Downloads the given video into the specified file .