Forum   Search   Register   Log in SUPERJER FORUM
 

How do you do that thing, with the thing, and the video?

Pages: [1]
Programming Help
sprinkles

Chrome Whore
2009 Sep 6 • 2480
10 ₧
So, basically how can I find out if a link is a video or not? Cause youtube doesn't have the normal .avi, .mp4eg, .badmovie extensions. So like how would I do that?

(with PHP)
...then I got some ap, and shot a big ass lazar at everyone.
    (Edited 2011 Mar 16 at 20:06)     2011 Mar 16 at 20:06
the_cloud_system
polly pushy pants

2008 Aug 1 • 2832
-6 ₧
WOOOOPS im not helping >_>
I am on a journey that I hope I will never finish.
    (Edited 2011 Mar 16 at 20:18)     2011 Mar 16 at 20:18
SRAW
Rocket Man

2007 Nov 6 • 2146
601 ₧
WOOOPS IM NOT HALPING
Free Steam Games
    2011 Mar 16 at 23:36
the_cloud_system
polly pushy pants

2008 Aug 1 • 2832
-6 ₧
SRAW said:
WOOOPS IM NOT HALPING

I am on a journey that I hope I will never finish.
    2011 Mar 17 at 00:06
SRAW
Rocket Man

2007 Nov 6 • 2146
601 ₧
What about your post above mine?

Free Steam Games
    2011 Mar 17 at 02:29
superjer
superjer

2005 Mar 20 • 3762
sprinkles said:
So, basically how can I find out if a link is a video or not? Cause youtube doesn't have the normal .avi, .mp4eg, .badmovie extensions. So like how would I do that?

(with PHP)


You can try doing a HTTP HEAD request on the link, and then checking the Content-Type.
    2011 Mar 17 at 12:35
sprinkles

Chrome Whore
2009 Sep 6 • 2480
10 ₧
Is that what superjer.com uses? Cause I'm getting text/html.

Content-Type: text/html; charset=utf-8 )

I guess all youtube videos have this:
code
watch?v=

So I'll use regex to find that, then embed the video into an object or whatever.

http://stackoverflow.com/questions/412467/how-to-embed-youtube-videos-in-php
...then I got some ap, and shot a big ass lazar at everyone.
    (Edited 2011 Mar 17 at 16:28)     2011 Mar 17 at 16:19
superjer
superjer

2005 Mar 20 • 3762
Oh well you're trying to check if the link is a page with a video.

In that case you need to search the content for a <embed> or <object> with video-y stuff in it. But really there's no way to be completely sure.

If you're targeting YouTube then the watch?v= thing is fine.

When you post a TouYube on here, the forum code looks for the BifRBx92S9I garbage and then wraps it in some embed code. So everything from links, to page source should work.

    2011 Mar 17 at 18:40
sprinkles

Chrome Whore
2009 Sep 6 • 2480
10 ₧
Any ideas on how to get the height?

(and width)

So you take that stuff after 'watch?v=,' throw it behind 'youtube.com/v/,' and you're done!
...then I got some ap, and shot a big ass lazar at everyone.
    (Edited 2011 Mar 17 at 19:11)     2011 Mar 17 at 19:06
superjer
superjer

2005 Mar 20 • 3762
You can choose from multiple different sizes when embedding YouTube videos. Check the options on YouTube.
    2011 Mar 17 at 19:17

Pages: [1]
Forum and design copyright © 2008-2010 SuperJer.com