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? Link to comment https://forums.phpfreaks.com/topic/133913-getting-video-resolution/ 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 Link to comment https://forums.phpfreaks.com/topic/133913-getting-video-resolution/#findComment-697071 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? Link to comment https://forums.phpfreaks.com/topic/133913-getting-video-resolution/#findComment-697095 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. Link to comment https://forums.phpfreaks.com/topic/133913-getting-video-resolution/#findComment-697101 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 Link to comment https://forums.phpfreaks.com/topic/133913-getting-video-resolution/#findComment-697106 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. Link to comment https://forums.phpfreaks.com/topic/133913-getting-video-resolution/#findComment-697107 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 Link to comment https://forums.phpfreaks.com/topic/133913-getting-video-resolution/#findComment-697112 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... Link to comment https://forums.phpfreaks.com/topic/133913-getting-video-resolution/#findComment-697115 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. Link to comment https://forums.phpfreaks.com/topic/133913-getting-video-resolution/#findComment-697116 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 Link to comment https://forums.phpfreaks.com/topic/133913-getting-video-resolution/#findComment-697119 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 Link to comment https://forums.phpfreaks.com/topic/133913-getting-video-resolution/#findComment-697148 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. Link to comment https://forums.phpfreaks.com/topic/133913-getting-video-resolution/#findComment-697372 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.