Question

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)));
  }
}
Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top