BlipTV storing process never finishes
| Project: | MM BlipTV |
| Version: | 5.x-0.1 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
I've simply changed the mm_bliptv module .info file to be "accepted" as D6 compatibility, and it seems to work without any compatibility problem.
When I set storing action as mm_bliptv (really _mm_bliptv_send) it remains in status "storing". The video file is uploaded to bliptv server correctly, and the return response of the server seems correct (it returns the link of the video file, I checked).
The status of the config is always:
There are 1 files that Media Mover has not finished processing. These files may not ever finish. You can remove them all at once
This is the return code of the function:
function _mm_bliptv_send($file, $configuration, $action) {
(...)
// add info to $file
$file[$action .'_module'] = "mm_bliptv";
$file[$action .'_action'] = "move file to blip.tv service";
$file[$action .'_file'] = $file_url;
$file['bliptv_id'] = $file_id;
$file['url'] = $file_url;
return $file;
}($file_url is like "http://blip.tv/file/1524169")
I don't know if it returns "good" values...? may be the problem is here.

#1
Woops- yes, the API has changed slightly. Now all that needs to be returned from the function is the new file path. You can modify the $file array which will be saved as it is passed by reference, but the way that MM figures out if the action was successful is by either getting false, true, or the file path. So in your case
return $file_url;is likely all you need to change.This has actually been updated in D5 as well- see: http://drupal.org/node/276134 for more details and I'm also happy to answer any questions.
#2
Thank you, now it works.
For anyone interested, I've written a piece of code to obtain the embedding blip.tv video from the blip server through the bliptv API.
It is: from a file url http://blip.tv/file/1571481 it obtains:
<embed src="http://blip.tv/play/AeDzYJHyNA" type="application/x-shockwave-flash" width="128" height="126" allowscriptaccess="always" allowfullscreen="true"></embed><?php
function _get_bliptv_embed($file_url) {
$response = array();
$timeout = 3000;
set_time_limit($timeout;
if(empty($file_url))
return FALSE;
$curl_session = curl_init();
curl_setopt($curl_session, CURLOPT_URL, $file_url ."?skin=api");
curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl_session, CURLOPT_TIMEOUT, $timeout);
$response['data'] = curl_exec($curl_session);
if (curl_errno($curl_session)) {
$response['error'] = curl_error($curl_session);
}
curl_close($curl_session);
if ($response['error']) {
watchdog('bliptv', "CURL error: " . $response['error'] . " for file " . $post_data['file'], 'WATCHDOG_ERROR');
return FALSE;
}
$data = trim($response['data']);
$vals = $index = $array = array();
$parser = xml_parser_create();
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
$xml_parse_result = xml_parse_into_struct($parser, $data, $vals, $index);
$embed = '<strong>(Processing video...)</strong>';
if ($xml_parse_result == 0) {
$file_id = 0;
//$embed = ""; //here may return FALSE
$message = t("Error in blip.tv answer: ") . xml_error_string(xml_get_error_code($parser)) . t(" at line ") . xml_get_current_line_number($parser);
watchdog('bliptv', $message, 'WATCHDOG_ERROR');
}
else {
$status = $vals[$index['status'][1]]['value'];
//if you want the embed also in "queue processing" status, must comment the next if
if($status == 'Completed')
$embed = $vals[$index['embedCode'][0]]['value'];
}
xml_parser_free($parser);
return $embed;
}
?>
#3
can you post the .module code and the .info code? did you change anything else?
i did the same thing with the info file, but the video never actually uploads to blip. thanks.
#4
Try this.
#5
I just assigned this to the mm bliptv module
#6
so do i need to replace the version of blip mm module with this? I am assuming so.
Chris