Jump to content

Getting video resolution?


Strahan

Recommended Posts

Hello!  I have some video files I want to embed in a website.  Problem is, I don't know the resolutions.  If I don't pass res to the object for video, it makes it a real small window with the controls off screen so I need to find the res. 

 

Is there any way to do that?

Link to comment
https://forums.phpfreaks.com/topic/133913-getting-video-resolution/
Share on other sites

<?
if(isset($HTTP_COOKIE_VARS["users_resolution"]))
$screen_res = $HTTP_COOKIE_VARS["users_resolution"];
else //means cookie is not found set it using Javascript
{
?>
<script language="javascript">
<!--
writeCookie();

function writeCookie()
{
var today = new Date();
var the_date = new Date("December 31, 2023");
var the_cookie_date = the_date.toGMTString();
var the_cookie = "users_resolution="+ screen.width +"x"+ screen.height;
var the_cookie = the_cookie + ";expires=" + the_cookie_date;
document.cookie=the_cookie

location = 'get_resolution.php';
}
//-->
</script>
<?
}
?>
</HEAD>
<BODY>
<?php
echo "Your Screen resolution is set at ". $screen_res;
?> 

 

Google.com

Sorry guys, my kid drug me away from the computer and I didn't have a chance to get back to it yet.  As much as I love my coding, priorities are priorities :)

 

What I need is the res of a video file, an MPG or AVI or such.  I tried just leaving off the res and hoping the object autosizes, but alas that doesn't work.  Interestingly with the code to play mpg if I specify it too large it does auto resize in the Y dimension, but not the X so I get a skewed aspect ratio.  For the love of God, why did they make it nice in only one dimension??  Hehe.

 

Thanks, and sorry again for the latent update.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.