$options['CoderFileURL'] .= $host . '/' . $path_cgi . 'decoded.php?id=' . $mash_media_id; $options['CoderFileURL'] = authenticated_url($options['CoderFileURL']); } } else { // TODO: Change name of S3Bucket $bucket_path = $moviemasher_client->getOption('S3Bucket') . '/' . $path_media; $options['CoderFileURL'] .= $bucket_path . $mash_media_id . '/' . $coder_filename . '.' . $decoder_extension; } if ($moviemasher_client->progressesLocally()) { $options['CoderProgressURL'] = 'http://' . $host . '/' . $path_cgi . 'progress.php?id=' . $mash_media_id; $options['CoderProgressURL'] = authenticated_url($options['CoderProgressURL']); } $options['CoderDoneURL'] = 'http://' . $host . '/' . $path_cgi . 'done.php?id=' . $mash_media_id; $options['CoderDoneURL'] = authenticated_url($options['CoderDoneURL']); $options['CoderErrorURL'] = 'http://' . $host . '/' . $path_cgi . 'error.php?id=' . $mash_media_id; $options['CoderErrorURL'] = authenticated_url($options['CoderErrorURL']); // absolute URLs to mash, policy file, applet and base path $options['DecoderConfigURL'] = 'http://' . $host . '/' . $mash_xml_path; $options['DecoderPolicyURL'] = 'http://' . $host . '/' . 'crossdomain.xml'; $options['DecoderAppletURL'] = 'http://' . $host . '/' . $path_swf . 'com/moviemasher/core/MovieMasher/stable.swf'; $options['CoderBaseURL'] = 'http://' . $host . '/' . substr($path_site, 0, -1); // set options, post, and retrieve job id try { $moviemasher_client->setOptions($options); $job_id = $moviemasher_client->post('decode'); } catch (Exception $ex) { $err = xml_safe($ex->getMessage()); } } if (!$err) { $xml = '<moviemasher url="media/php/decoding.php?id=' . $mash_media_id . '&job=' . $job_id . '" progress="2" status="Decoding..." delay="5" />';
$options['CoderErrorURL'] = authenticated_url($options['CoderErrorURL']); // specify URL to hit in case of encoding error $options['CoderDoneURL'] = 'http://' . $host . '/' . $path_cgi . 'addmedia.php?id=' . $id; $options['CoderDoneURL'] = authenticated_url($options['CoderDoneURL']); if ($moviemasher_client->progressesLocally()) { $options['CoderProgressURL'] = 'http://' . $host . '/' . $path_cgi . 'progress.php?id=' . $id; $options['CoderProgressURL'] = authenticated_url($options['CoderProgressURL']); } // CoderFileURL $options['CoderFileURL'] = strtolower($moviemasher_file->getOption('File')) . '://'; if ($uploads_locally) { if ($renders_locally) { $options['CoderFileURL'] .= substr($dir_host, 1) . $path_media . $id; } else { $options['CoderFileURL'] .= $host . '/' . $path_cgi . 'encoded.php?id=' . $id; $options['CoderFileURL'] = authenticated_url($options['CoderFileURL']); } } else { // TODO: Change name of S3Bucket $bucket_path = $moviemasher_file->getOption('S3Bucket') . '/' . $path_media; $options['CoderFileURL'] .= $bucket_path . $id . '/'; } // provide hints for files having only one type of AV content $options['CoderNoVideo'] = $type == 'audio' ? 1 : 0; // see if an archive is required (only tgz is supported currently) if ($uploads_locally && !$renders_locally) { $options['CoderArchiveExtension'] = 'tgz'; } } // post encode job to Movie Masher Server if (!$err) {