MediaVid

^do( MediaVid, filename, [type] )^

Type: Macro

Purpose: Embeds a 4x3 HTML5 video player

The MediaVid macro inserts the barebones HTML5 video player. For why the poster element is important here (and how to set it), see The Directories Dash. Also, be sure you have set your online uploads directory in the Directories Dash.

  • If BoxPress detects the regex "https??://" inside the filename arg, it will treat it as a full url and will not prepend your Uploads Directory (set in the Directories Dash) in the url path.
  • To speed load times, you can also now include an optional second arg, specifying the media type attribute. If this is left blank, video/mp4 is used.

To embed Flash (YouTube) videos, use MediaTube (responsive) or MediaTubeSmall.

Hover below to reveal BoxPress code

<div class="embed-responsive embed-responsive-4by3 m-tb-img">
<video class="embed-responsive-item" preload="metadata" controls ^if($Text("dashPoster"))^poster="^value($Text("dashPoster"))^"^endIf^> <source src="^if(!$1.contains(https??://))^^value($Text("dashUploadsDir"))^/^endIf^$1" type="^if($2)^$2^else^video/mp4^endIf^" >Your browser does not support HTML5 video.</video></div>

MediaVid sample

This is the markup that is rendered below

^do(MediaVid, "MediaVid_sample.mp4")^

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Day of the Robot

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.