如何从服务器上传和播放不同格式的视频?

I'm using a goDaddy server and cPanel to make a website, and I want to make a feature that lets users upload videos, save them on the server, then display them elsewhere on the site.

echo "<iframe src='uploads/videos/sample.mov' frameborder='0' allowfullscreen></iframe>";

How can i get video formats like .mov to play on the site after they are uploaded on the server?

We’re currently able to get mp4 to work with the below code, but I don’t want to limit users to only upload mp4

if(isset($_FILES["submit_file"])){ //this comes from an html form
$name = $_FILES['submit_file']['name'];
$original_name = $name;
$size = $_FILES['submit_file']['size'];
$tmp_name = $_FILES['submit_file']['tmp_name'];
$target_dir = null;

$finfo = finfo_open(FILEINFO_MIME_TYPE);//get mime type
$mime = finfo_file($finfo, $tmp_name);

if ($mime == "video/mp4" || $mime == "video/wmv" || $mime == "video/avi" || $mime == "video/mov")
{
    $target_dir = "uploads/videos/";
    $path = $target_dir . basename($name);

    if (move_uploaded_file($tmp_name, $path) == true) {
        //moved
    }
}else{
    //error: Unsupported File Type;
}
}

How do sites like facebook allow uploading videos other than mp4? I looked into using FFmpeg to convert everything to mp4, but I don't see how to install and use that on the godaddy server.

Effectively, sites like Facebook doesn't just store the video in their filesystems but convert them using FFmpeg or similar library. You won't be able to install it unless you're running a VPS or Dedicated Server. If you are running a Shared hosting the service provider could install it for you but in my experience they won't because you will consume the resources of the people sharing the instance with you (seems legit :) )

About the code, it's is just checking the file mime type prior to save it to your storage and as far as I can see it should accept other formats like avi, wmv and mov.

Take in count that that code won't check that the file is effectively a video file, it'll just check the extension (the file could have encoding errors and you wouldn't know).