I'm trying to embed html5 video using the custom formatters module for D7. The player shows but evaluating the source I can see the the filepath are not formatted correctly. Any help would be appreciated. The code I'm using is this:

// Define video file locations
$m4v_video = file_create_url($element[0]['#item']['uri']);
$webm_video = file_create_url($element[1]['#item']['uri']);
$ogv_video = file_create_url($element[2]['#item']['uri']);
// Print HTML5 video code
print '<div class="html5-video-player">
  <video id="video" controls preload width="640" height="360">
    <source src="' . $m4v_video . '" type="video/mp4" />
    <source src="' . $webm_video . '" type="video/webm" />
    <source src="' . $ogv_video . '" type="video/ogg" />
  </video>
</div>';

And this is the html output of the above code

<div class="html5-video-player">
  <video id="video" controls="" preload="" width="640" height="360">
    <source src="http://example.com/" type="video/mp4">
    <source src="http://example.com/" type="video/webm">
    <source src="http://example.com/" type="video/ogg">
  </video>
</div>

Comments

dre2phresh’s picture

Is there anyone that can point men in the right direction?