Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By dre2phresh on
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
Is there anyone that point
Is there anyone that can point men in the right direction?