如何使用html5在目录中播放/显示视频

I do not know how to get videos in a folder to play in html or php. I know how to do a single video but that's not what I want. I want to display and play videos that are in a directory folder. Is their a certain way to do this. I tried this code but it doesn't work and I tried other codes. I know in the code below its connected to a database. I have managed to upload videos but can't display them.

none of the solutions given is working but let me ask a simpliar question can I do this to get not just one particular video but all the videos with a path to the folder with videos. I think the code above has a lot of errors and it was the only one i could find so I'm not trusting the code above.

Can you try the following?

 <?php
    $query = "select * from videos where `id`='" . $id . "'";
    $select = mysql_query($query);

    while (($row = mysql_fetch_assoc($select)) != null)
    {
        $video = $row['video'];

        print '<video width="320" height="240" controls>' .
                '<source src="uploadvideo/' . $video . '" type="video/mp4">' . 
                '<source src="video/' . $video . '" type="video/ogg" />' .
                'Your browser does not support the video tag.' .
            '</video>';
    }
?>

There are a few tweaks in there, such as using backticks around the column name, inputting a message for if your browser does not support the video tag (taken from here), and handling a null result.

Also, maybe you need to stick a / in front of video/ and uploadvideo/? e.g. if your videos are located in one folder below the document root, such as wwww.mydomain.com/video/vid-name-here.mp4

Another thing, have you removed the file extensions from all the videos, or is the file extension kept in the database for both mp4 and ogg videos? Perhaps you want to attach .mp4 and .ogg accordingly in the source links to be like so:

'<source src="uploadvideo/' . $video . '.mp4" type="video/mp4">' . 
'<source src="video/' . $video . '.ogg" type="video/ogg" />' .
 <?php
    $query = "select * from `videos` where `id`='" . $id . "'";
    $result = mysql_query($query);
    if(mysql_num_rows($result) > 0){
      while ($row = mysql_fetch_array($result))
      {
        $video = $row['video'];

        echo '<video width="320" height="240" controls>' .
                '<source src="uploadvideo/' . $video . '" type="video/mp4">' . 
                '<source src="video/' . $video . '" type="video/ogg" />' .
                'Your browser does not support the HTML5 tags.' .
            '</video>';
     }
   }
?>