Мне нужно встроить приватное видео dailymotion с помощью 'dailymotion-sdk-php'. Я создал учетную запись и добавил ключ и секрет. Но внутри iframe я получаю сообщение «Частный контент».Невозможно получить код iframe для частного видео с dailymotion api
Это мой код,
<?php
error_reporting(E_ALL & ~E_NOTICE);
ini_set('display_errors', 1);
set_time_limit(0);
$apiKey = 'my key';
$apiSecret = 'my secret';
require_once 'Dailymotion.php';
// Instanciate the PHP SDK.
$api = new Dailymotion();
// Tell the SDK what kind of authentication you'd like to use.
// Because the SDK works with lazy authentication, no request is performed at this point.
$api->setGrantType(Dailymotion::GRANT_TYPE_AUTHORIZATION, $apiKey, $apiSecret);
// $api = new Dailymotion();
try
{
$result = $api->get(
'/video/my id',
array('fields' => array('id', 'title', 'owner'))
);
}
catch (DailymotionAuthRequiredException $e)
{
echo $e->getMessage();
// If the SDK doesn't have any access token stored in memory, it tries to
// redirect the user to the Dailymotion authorization page for authentication.
return header('Location: ' . $api->getAuthorizationUrl());
}
catch (DailymotionAuthRefusedException $e)
{
echo $e->getMessage();
// Handle the situation when the user refused to authorize and came back here.
// <YOUR CODE>
}
trace($result);
function trace($d) {
echo '<pre>';
var_dump($d);
echo '</pre>';
echo '<iframe frameborder="0" width="480" height="270" src="http://www.dailymotion.com/embed/video/my id"></iframe>';
}
?>
Было бы здорово, если бы кто-то может помочь мне в архив этот
Got it. И было бы здорово, если бы вы могли проверить его с помощью tocken. Тогда это будет более безопасно. – vimuth