BrightcoveOS/PHP-MAPI-Wrapper — pull request #18 by steevhise (2012-09-18 19:06:16+00:00)
Title: added createCaptions method

Hi, in light of the new Brightcove closed captioning functionality in the Media API, I added an appropriate method in the PHP wrapper that I thought you might want to pull in.
(in fact, a brightcove person on the BC community forum suggested it.)

So far this just handles remote-hosted captions, not uploading
xml directly to BC.

example use (from a Drupal implementation) would be:
```php
// set the closed-caption XML file url, if there is one.
if($cc_xml_path = $node->field_cc_xml[0]['filepath']) {
$cc_xml_url = "$base_url/$cc_xml_path";
// $cc_xml_url = "http://mun2.tv/$cc_xml_path"; // for now., testing
$caption_source = array( 'displayName' => "caption for " . $node->title,
'url' => $cc_xml_url,
);
try {
$response = $bc->createCaptions($caption_source, $id = $meta['id']);
} catch (Exception $error) {
drupal_set_message('Brightcove Error: Unable to set closed captions: ' . $error);
}
}
```

reference:
http://forum.brightcove.com/t5/Media-APIs/adding-Closed-Captions-via-Media-API/m-p/21306

thanks,

steev