Embedding YouTube

From: ANT_THOMAS18 Jul 2012 12:55
To: ALL1 of 17
What's the best way to embed YouTube videos these days?

I'm currently using the "old embed code" but IE9 doesn't seem to like it. Or do I just not have Flash installed?

Rather not use the iframe.

Though Beehive uses the iframe version.
From: ANT_THOMAS18 Jul 2012 13:04
To: ANT_THOMAS 2 of 17
I didn't have flash installed :$ (fail)
From: Lucy (X3N0PH0N)18 Jul 2012 13:15
To: ANT_THOMAS 3 of 17
(hug)
From: Peter (BOUGHTONP)18 Jul 2012 13:23
To: ANT_THOMAS 4 of 17
quote:
Rather not use the iframe.

Why the fuck not?

quote:
I didn't have flash installed

youtube.com/html5

Wasn't perfect last time I checked, but it's improving.
From: Ken (SHIELDSIT)18 Jul 2012 13:24
To: Lucy (X3N0PH0N) 5 of 17
Is there a emote that would represent retardedness?
From: ANT_THOMAS18 Jul 2012 13:25
To: Peter (BOUGHTONP) 6 of 17

No sensible reason.

 

The iframe way looks no different and is less lines of code so I might use it.

From: Peter (BOUGHTONP)18 Jul 2012 13:26
To: ANT_THOMAS 7 of 17
It's exactly the situation when an iframe makes sense / is intended to be used.
From: Peter (BOUGHTONP)18 Jul 2012 13:27
To: Ken (SHIELDSIT) 8 of 17
From: Peter (BOUGHTONP)18 Jul 2012 13:27
To: Ken (SHIELDSIT) 9 of 17
Sorry, I had to! (hug)
From: Ken (SHIELDSIT)18 Jul 2012 13:29
To: Peter (BOUGHTONP) 10 of 17
:-O
From: Lucy (X3N0PH0N)18 Jul 2012 13:31
To: Peter (BOUGHTONP) 11 of 17
S'pretty much perfect now. (html5 youtube, that is)
From: ANT_THOMAS18 Jul 2012 13:39
To: Peter (BOUGHTONP) 12 of 17
And with there being far less code it is much easier to have that part linked to a database too.
From: Peter (BOUGHTONP)18 Jul 2012 13:45
To: ANT_THOMAS 13 of 17
Yep.

Although I still say you probably want auto-discovery and a few minimal config files. :P
From: ANT_THOMAS18 Jul 2012 14:43
To: Peter (BOUGHTONP) 14 of 17
Auto-discovery of Photos in a folder? (or are you talking about something else?)
From: Peter (BOUGHTONP)18 Jul 2012 14:46
To: ANT_THOMAS 15 of 17
Yes, and videos in a channel/playlist, and whatever else info you're duplicating into a database.
From: ANT_THOMAS18 Jul 2012 14:51
To: Peter (BOUGHTONP) 16 of 17

So how would you do the photo part of it?

 

Let's say I have 6 folders of photos (living on a different server). How would you go about displaying them with thumbnails (thumbs will live on the other server too)? With a similar outcome to what I already have.

From: Peter (BOUGHTONP)18 Jul 2012 15:36
To: ANT_THOMAS 17 of 17
I don't remember the details of the outcome you currently have, but it's all pretty simple.

Every X minutes and/or when executing a particular script, do a directory listing for the parent directory of those six folders, and cache the results in a local text file (or if they are separate galleries do one file per folder).

Directory listing can be over HTTP or FTP or REST API or whatever - specifics of that will depend on what server supports and how easy PHP can do the appropriate things. (Search for if PHP can do virtual filesystems, if not, look at the appropriate FTP/file related functions.)

Then to output the files you just split it per line, like you already did before. Thumbnails can either be in a sub-directory with same filename, or be named filename.thumb.jpg, so you only need to do the listing once, and just output the a/href differently to the img/src.

No MySQL necessary.