Magic Icon HTML5 Video: Magic JavaScript

Quick Jump ↵

Currently playing FLV, MP4, OGG and WebM videos

Usage

Add <script type="text/javascript">$m.wand.html5_video = true;</script> inside your <body> tag.

Use the example below as a guide for building your own!

PS.. remove the comments since we're working in a <div>.

Example

The video has reached the end and the do_callback() function just fired!

Your browser can't play this video.

Play
<a href="#" data-mjf="html5_video_play|return_false" data-mjf_h5v_video_id="magic_media_video_cont" id="magic_media_video_play">Play</a>

Pause
<a href="#" data-mjf="html5_video_pause|return_false" data-mjf_h5v_video_id="magic_media_video_cont" id="magic_media_video_pause">Pause</a>

Stop
<a href="#" data-mjf="html5_video_stop|return_false" data-mjf_h5v_video_id="magic_media_video_cont" id="magic_media_video_stop">Stop</a>

Go to 5 seconds
<a href="#" data-mjf="html5_video_seek|return_false" data-mjf_h5v_video_id="magic_media_video_cont" data-mjf_h5v_seek_time="5" id="magic_media_video_seek_5">Go to 5 seconds</a>

Go to 50 seconds
<a href="#" data-mjf="html5_video_seek|return_false" data-mjf_h5v_video_id="magic_media_video_cont" data-mjf_h5v_seek_time="50" id="magic_media_video_seek_50">Go to 50 seconds</a>

Go to the end
<a href="#" data-mjf="html5_video_end|return_false" data-mjf_h5v_video_id="magic_media_video_cont" id="magic_media_video_end">Go to the end</a>

Notes

Even though all video filenames are optional, you probably should include at least one.

The inserted <video> -or- <object> elements have IDs: id="ELEMENT_ID_video".

If you're using FLV videos, the data-mjf_h5v_path must be relative.

FLV videos don't support the data-mjf_h5v_poster attribute - yet.

FLV videos will all share the same JavaScript callback since there is only one SWF player.

Need to convert your video? The free Miro Video Converter does MP4, OGG, and WebM.

The FLV player is a heavily modified version of the OS FLV v3.0.

To Do

Re-enable the data-mjf_h5v_autoload="true" and data-mjf_h5v_autoplay="true" attributes.

Update flash player to OS FLV v4.2.

Add <object><embed></object> fallback when nothing else works.

Add player branding for HTML5 players.

« Back to the main documentation