AVI and MKV cant be played by classic HTML5 players.

one way is to use DivX web player to play it: http://labs.divx.com/WebPlayerCodeGenerator

Example code:
Code:
<object classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" width="640" height="500" codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab">


 <param name="custommode" value="none" />


  <param name="loop" value="true" />
  <param name="src" value="VIDEOURLHERE" />


<embed type="video/divx" src="VIDEOURLHERE" custommode="none" width="640" height="500" loop="true"  pluginspage="http://go.divx.com/plugin/download/">
</embed>
</object>
<br />No video? <a href="http://www.divx.com/software/divx-plus/web-player" target="_blank">Download</a> the DivX Plus Web Player.
To play video, AC3filter may be needed


=========

If you need to input video url instead having it permanently in website source code you can use my script.

basically its like:


index.php
Code:
<form name="input" action="player.php" method="post">URL to play (avi, mkv): <input type="text" name="url">
<input type="submit" value="Play">
</form>
player.php
Code:
<?php

ini_set('display_startup_errors',1);
ini_set('display_errors',1);
error_reporting(-1);


if (isset($_POST['url'])){
   $url2 = $_POST['url'];
   $url3 = htmlspecialchars("$url2", ENT_QUOTES);
echo "<center><div>" . $url3 . "</div></center><br /><br />";


echo '
<html><head><title>Player</title></head>
<body bgcolor="#00000">
<center>


<object classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" width="640" height="500" codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab">
 <param name="custommode" value="none" />
  <param name="loop" value="true" />
  <param name="src" value="' . $url3 . '" />
<embed type="video/divx" src="' . $url3 . '" custommode="none" width="640" height="500" loop="true"  pluginspage="http://go.divx.com/plugin/download/">
</embed>


</object>
</center>
</body>
</html>';


}
else {
echo "No variable";
}


?>
open index.php and input url of a file and then its played by player.php

=====

If you need more sofisticated web media player, try this: http://internetlifeforum.com/general-webmaster-discussion/1814-web-php-script-play-video-audio-files-subfolders-divx-flv-mp4-mp3