Show an elggfile in another object's view

Hello, I'm trying (vainly) to show an uploaded file in the view of another object.

The file is an mp3 and uploads and plays fine using zaudio in it's own view. I want to get that zaudio into another object's view. I've managed to get the zaudio to appear by using the following code from the file object view:


if (elgg_view_exists('file/specialcontent/' . $mime)) {

echo "<div class=\"filerepo_specialcontent\">".elgg_view('file/specialcontent/' . $mime, $vars)."</div>";

} else if (elgg_view_exists("file/specialcontent/" . substr($mime,0,strpos($mime,'/')) . "/default")) {

echo "<div class=\"filerepo_specialcontent\">".elgg_view("file/specialcontent/" . substr($mime,0,strpos($mime,'/')) . "/default", $vars)."</div>";


The reason it's showing is because I've set the mimetype to the guid of my test file. However when I click play it stays on "buffering" forever. So it can read successfully from the test file in terms of mimetype which I've got in the following way:

$test_guid = $guid +1;

$testfile = get_entity($test_guid);

$mime = $testfile->mimetype;


But it doesn't seem to want to play the file. So I'm assuming somewhere in the code at the top I need to add the test file's guid somewhere.

Any help or direction is appreciated. I have searched (quite extensively) in the docs and API and on the community as well, so far with little or no luck.