doucheng9304 2013-07-23 21:51
浏览 48
已采纳

ooyala没有使用drupals版本6模块与ooyala的背景同步描述或标签。

Recently on our site ooyala's v1 api stopped allowing us to sync with ooyala's backlot. Our site is built on Drupal, version 6. So I upgraded to the latest version 6 Ooyala module and made the changes to our local code. Now I can use a drupal_http_request() to sync the title but it won't sync the description or labels to Ooyala's backlot. below is the function I'm using.

     $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;
}

This is the output message I get.

-request= -Function:

--Title: test title --Description: test description --Failed to sync the title and description to Ooyala. Please try saving again.

So the title and description is attached on the same http request and the embed code is correct. The title does sync to the backlot but the description does not. the request back from ooyala is empty. Not sure what is going on. Any help in pointing me in the right direction would be appreciated.

Also in the errors logs I receive this error from the ooyala.api on the foreach statement.

Invalid argument supplied for foreach() in /sites/all/modules/ooyala/includes/ooyala.api.inc on line 316.

    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)));
  }
}
  • 写回答

1条回答 默认 最新

  • douyin4561 2013-08-22 14:32
    关注

    After weeks with working on this Ooyala confirmed that there is a bug in the drupal module. Which is written in partnership with Lullabot.

    They will release it in their next update. 6.x-2.beta5

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看