You are here

function emvideo_imeem_thumbnail in Embedded Media Field 6.3

Same name and namespace in other branches
  1. 6 contrib/emvideo/providers/imeem.inc \emvideo_imeem_thumbnail()

File

contrib/emvideo/providers/imeem.inc, line 76

Code

function emvideo_imeem_thumbnail($field, $item, $formatter, $node, $width, $height) {
  $xml = emvideo_imeem_request($item['value']);
  $tmpthm = $xml['ITEM']['ICONURL'][0];
  $imgmax = $xml['ITEM']['DURATION'][0];
  $formatnum = str_pad(rand(0, $imgmax) . '.jpg', 9, "0", STR_PAD_LEFT);
  $thm = str_replace('00010.jpg', $formatnum, $tmpthm);
  return $thm;
}