Strahan Posted November 23, 2008 Share Posted November 23, 2008 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? Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted November 23, 2008 Share Posted November 23, 2008 There isn't any way from PHP. You'd have to use a javascript to determine that information, and then pass it through to the server as part of the request Quote Link to comment Share on other sites More sharing options...
Mchl Posted November 23, 2008 Share Posted November 23, 2008 Hold on Mark. Is it resolution of video file, or resolution of user's display we're talking? Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted November 23, 2008 Share Posted November 23, 2008 Hold on Mark. Is it resolution of video file, or resolution of user's display we're talking? True, I'm jumping to conclusions in assuming that it's secreen resolution. Quote Link to comment Share on other sites More sharing options...
dezkit Posted November 23, 2008 Share Posted November 23, 2008 <? 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 Quote Link to comment Share on other sites More sharing options...
DarkWater Posted November 23, 2008 Share Posted November 23, 2008 He wasn't asking for screen resolution; read the thread title. Quote Link to comment Share on other sites More sharing options...
dezkit Posted November 23, 2008 Share Posted November 23, 2008 He was asking for screen resolution; check his latest post Quote Link to comment Share on other sites More sharing options...
Mchl Posted November 23, 2008 Share Posted November 23, 2008 Given he only posted once in this topic.. hmm... Quote Link to comment Share on other sites More sharing options...
DarkWater Posted November 23, 2008 Share Posted November 23, 2008 He was asking for screen resolution; check his latest post Funny, he only posted once in this thread. Quote Link to comment Share on other sites More sharing options...
dezkit Posted November 23, 2008 Share Posted November 23, 2008 Hold on Mark. Is it resolution of video file, or resolution of user's display we're talking? True, I'm jumping to conclusions in assuming that it's secreen resolution. Oh god, I thought Mark is the OP. Sorry guys Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted November 23, 2008 Share Posted November 23, 2008 Oh god, I thought Mark is the OP. It happens.... I didn't see the original post as ambiguous until it was pointed out Quote Link to comment Share on other sites More sharing options...
Strahan Posted November 24, 2008 Author Share Posted November 24, 2008 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.