Why is file_create_url() returning inconsistent values? I'm experiencing an inconsistent behaviour in Drupal 7 on the function file_create_url(). I have one field collection with 4 fields in it. On the first field the function provides the correct file url. For the other 3 fields it displays only first part of url. How can I get rid of this?

Here is my code:

&lt;video controls="controls"  autoplay="autoplay" poster="&lt;?php print file_create_url($content["field_poster"][0]["#item"]["uri"]); ?&gt;" style="width:100%"   &gt;
  &lt;source src="&lt;?php print file_create_url($content["field_mp4"][0]["#item"]["uri"]); ?&gt;" type="video/mp4" /&gt;
  &lt;source src="&lt;?php print file_create_url($content["field_webm"][0]["#item"]["uri"]); ?&gt;" type="video/webm" /&gt;
  &lt;source src="&lt;?php print file_create_url($content["field_ogg_theora"][0]["#item"]["uri"]); ?&gt;" type="video/ogg" /&gt;
&lt;/video&gt;


And here is the result: field_poster is fine but the others fail;


&lt;?php print_r($content["field_poster"][0]); print_r($content["field_mp4"][0]); ?&gt;


leads to...

            Array
(
[#theme] =&gt; image_formatter
[#item] =&gt; Array
    (
        [fid] =&gt; 288
        [uid] =&gt; 1
        [filename] =&gt; Transgourmet_Waldputen_MASTER.jpg
        [uri] =&gt; public://Transgourmet_Waldputen_MASTER.jpg
        [filemime] =&gt; image/jpeg
        [filesize] =&gt; 65241
        [status] =&gt; 1
        [timestamp] =&gt; 1440456242
        [type] =&gt; image
        [rdf_mapping] =&gt; Array
            (
            )

        [image_dimensions] =&gt; Array
            (
                [width] =&gt; 1008
                [height] =&gt; 573
            )

        [alt] =&gt; 
        [title] =&gt; 
        [width] =&gt; 1008
        [height] =&gt; 573
    )

[#image_style] =&gt; 
[#path] =&gt; 
)
Array
(
[#theme] =&gt; file_link
[#file] =&gt; stdClass Object
    (
        [fid] =&gt; 289
        [uid] =&gt; 1
        [filename] =&gt; Transgourmet_Waldputen_MASTER.m4v
        [uri] =&gt; public://Transgourmet_Waldputen_MASTER.m4v
        [filemime] =&gt; video/x-m4v
        [filesize] =&gt; 34256348
        [status] =&gt; 1
        [timestamp] =&gt; 1440457177
        [type] =&gt; video
        [rdf_mapping] =&gt; Array
            (
            )

        [display] =&gt; 1
        [description] =&gt; 
    )

)


Is it possible that is has to do with the mime-types?

Thanks in advance.
For each of the video files, this (for example):

$content["field_mp4"][0]['#item']['uri']


should be this:

$content["field_mp4"][0]['#file']-&gt;uri


Change #item to #file and change the syntax to reference an object instead of an array.