最近在我们的网站上,ooyala的v1 api停止了,允许我们与ooyala的后台同步。我们的站点是在Drupal版本6上构建的,所以我升级到了最新版本6 Ooyala模块,并对我们的本地代码进行了修改。现在,我可以使用drupal_http_request()来同步标题,但是它不会将描述或标签同步到Ooyala的后台。下面是我正在使用的函数。
$request_test = video_update_ooyala_info($embed_code, $node->title, $node->field_video_description[0]['value']);
drupal_set_message("-request=
".print($request_test)."
-Function: </br>--".var_dump($embed_code)."
</br>--Title: ".$node->title."
</br>--Description: ".$node->field_video_description[0]['value']. "
</br>--Failed to sync the title and description to Ooyala. Please try saving again.", 'warning');
}
function video_update_ooyala_info($embedcode, $title, $description) {
$ooyala_api = new OoyalaDrupalWrapper('sksnuKYFA0t8Lxs0FT2WmgIsftVKRtLVtflJSWP8', '52OW06CJSttaayZSm0kW3ZoSKvxA.QXRId');
$request = $ooyala_api->signed_params(
array(
'embedCode' => $embedcode,
'title' => $title,
'description' => $description,
)
);
$request_headers = array('Content-Type' => 'application/x-www-form-urlencoded');
$request_method = 'patch';
$response = drupal_http_request("http://api.ooyala.com/v2/assets?xzOTEzYjpmjnBNLeBPSd53PVAAmSur9g",$request_headers,$request_method,$request);
$success = FALSE;
if ($response->data) {
$success = ($response->data == '200');
}
return $response;
}这是我得到的输出消息。
-request= -Function: -标题:测试标题--描述:测试描述--未能将标题和描述同步到Ooyala。请再试一次储蓄。
因此,标题和描述附加在相同的http请求和嵌入代码是正确的。标题与backlot同步,但描述不同步。从ooyala返回的请求是空的。不知道是怎么回事。如果能帮助我找到正确的方向,我将不胜感激。
同样,在错误日志中,我从foreach语句上的ooyala.api中接收到此错误。
为第316行的/sites/all/modules/ooyala/includes/ooyala.api.inc中的foreach()提供的无效参数。
function ooyala_api_video_label_add($embed_code, $labels) {
$ooyala_api = new OoyalaDrupalWrapper();
foreach ($embed_code as $embed) {
$ooyala_api->api->request(POST, "/v2/assets/$embed/labels", json_encode(array_values($labels)));
}
}发布于 2013-08-22 14:32:47
经过几周的工作,Ooyala证实了drupal模块中有一个bug。是和Lullabot合作写的。
他们将在下一次更新中发布。6.x-2.beta5
https://stackoverflow.com/questions/17821707
复制相似问题