You are here

function brightcove_create_callback in Brightcove Video Connect 7.7

Same name and namespace in other branches
  1. 7.6 brightcove.module \brightcove_create_callback()
1 call to brightcove_create_callback()
brightcove_upload_and_ingest in ./brightcove.module

File

./brightcove.module, line 2621
Brightcove module is an integration layer between any modules using Brightcove API. It makes all necessary checks for the API and makes settings available to the user.

Code

function brightcove_create_callback($hash, $video_id, $client_id, $fid = 0, $parent_entity_type = '', $parent_field_name = '', $parent_bundle_name = '', $metadata = []) {
  $callback = _brightcove_get_ingest_callback($hash);
  if (!$callback) {
    return FALSE;
  }
  db_insert('brightcove_callback')
    ->fields([
    'id' => $video_id,
    'expires' => time() + 60 * 60 * 24,
    'fid' => $fid,
    'hash' => $hash,
    'client' => $client_id,
    'parent_entity_type' => $parent_entity_type,
    'parent_field_name' => $parent_field_name,
    'parent_bundle_name' => $parent_bundle_name,
    'metadata' => json_encode($metadata),
  ])
    ->execute();
  return $callback;
}