There are two types of uploads for videos from mobile devices:
"On the spot" video uploads
This is where you click a file upload button and choose the option from your OS to record a video.
There's no standard way to tell the browser what type of video to record. Some phones have settings to control the resolution/quality. But I've noticed on iOS (lately) that it forces you to record at the lowest resolution, regardless of your settings.
I agree w/the comments, for best user experience let the user upload whatever their phone sends, then transcode the video on the server/in the cloud.
Uploading existing video files
You could use things like the HTML5 File API to enforce limits on the file size and even the resolution. I won't add any code here, the file size is straight forward.
For resolution, what I did was to load local video file into a <video>
tag, and then add a "loadedmetadata" event listener to it. When the "loadedmetadtata" event fires, you can then get the videoWdith
and videoHeight
as shown here.
I did this on the desktop, but I see no reason why it wouldn't work on a modern phone :)