Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Bom dia Senhores.
Pretendo usar o youtube como repositório de videos para um cliente meu.
Agora estou com o seguinte problema, não estou conseguindo passar os videos privados no meu site, roda somente se eu estiver logado no site do youtube, estou fazendo da seguinte forma.
<?php
require_once 'Zend/Loader.php'; // the Zend dir must be in your include_path
Zend_Loader::loadClass('Zend_Gdata_YouTube');
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
$authenticationURL = 'https://www.google.com/accounts/ClientLogin'; );
//print_r($httpClient);
//die;
$developerKey = 'AI39si6******';//chave developerKey nao vou colocar aqui XD
$applicationId = 'Video uploader v1';
$clientId = '**********';
$yt = new Zend_Gdata_YouTube($httpClient, $applicationId, $clientId, $developerKey);
$yt->setMajorProtocolVersion(2);
$videoIdOfPrivateVideo = 'cFP6AhWivB4';
$location = 'http://gdata.youtube.com/feeds/api/users/default/uploads/' . $videoIdOfPrivateVideo;
$videoEntry = $yt->getVideoEntry($videoIdOfPrivateVideo, $location);
?><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>YouTube data API Video Browser in PHP</title>
</head>
<body>
<div id="main">
<br />
<iframe id="ytplayer" type="text/html" width="640" height="360" src="<?php echo $videoEntry->getFlashPlayerUrl();?>" frameborder="0" allowfullscreen> </iframe>
</div>
</body>
</html>
Estou usando somente a biblioteca zend e nao o framework.
Eu tenho acesso a todas as informaçoes do video pelo
print_r($videoEntry);
e tudo mais mas quando tento ver o video pelo site com o:
<iframe id="ytplayer" type="text/html" width="640" height="360" src="<?php echo $videoEntry->getFlashPlayerUrl();?>" frameborder="0" allowfullscreen> </iframe>
Simplesmente ele informa que o vídeo é privado.
Alguém pode me dar uma luz de como fazer isso funfar.
Obrigado.
Carregando comentários...