Delivering video on the web is a giant clusterfuck.
It always has been, ever since the word go. The reason? Microsoft, Apple and their ilk being precious little babies, going "Waa waa waa that's MY codec and YOU can't use it unless you give me lots of money", so that everyone else has to cope with the difficulties created by their childish short-sighted greed and nobody benefits.
For a while there was a reasonable way around this - deliver video using flash. I would be the first to agree that flash is shite, but on the other hand it did have support on something like 98% or 99% of clients, with those few that didn't support it being mostly down to awkward sods like me who deliberately refused to install the flash plugin, which is a matter of choice so it doesn't count.
But then those fucking wankers Apple decided that their fucking piece of shit devices would not be allowed to support flash, and since they are fucking wankers of the highest order, there was no way for users of said piece of shit devices to install a flash plugin themselves and tell Apple to fuck off. And since people in general are fucking stupid, they failed to recognise this deliberate arseholery for what it was, blanked it out of their awareness along with all the other disadvantages of these bastard cunt machines, and carried on using them. And the big video sites such as youtube, instead of presenting users with a message informing them that the video would not play because Steve Jobs was a cunt and they should take a sledgehammer to his stupid invention and use a cheaper, more versatile device made by someone who was less of a cunt, caved. Which is a great shame otherwise these pissarsing cuntwank shite gadgets could well have been strangled at birth and the global idiocy quotient would have been kept lower. As it is we have a world where an increasing percentage of morons are brainwashed into accessing the web using a device which is totally unsuited to the job, and those of us who run websites on a lesser scale than youtube have no choice but to make things work on these pieces of shit or else lose a huge chunk of traffic.
(Note, too, that Steve Jobs was just being a cunt. His purported justification for not supporting flash was that the flash plugin is a CPU hog. Well, yes, it is. But what was his alternative? MP4. And that is also a fucking CPU hog. And when all the flash plugin is doing is playing a video it is the hogginess of the video format that largely determines the hogginess of the plugin. So he was talking a load of arse and being a great big jobby.)
The HTML5 standard was at one time the great hope for cutting out all this fucking bollocks and providing a simple straightforward <video> tag that would work on everything using just one, open, free format. Up until 2007 the HTML5 draft standard specified that Ogg Theora support should have been used by everything. But then they fucked up. For no well-defined reason they removed the requirement to support that format and did not replace it with a requirement to support anything else - and they have never sorted this out. They've had six years so far to sort it but they have done fuck all, and in the meantime HTML5-capable browsers have come into widespread use - all supporting a different combination of formats, and none supporting one single format in common. So we have exactly the same pissing useless situation as we had before, and the one single aspect of HTML5 that would genuinely have been really useful as opposed to merely facilitating yet more pointless flashy rubbish has been crippled by moronic stupidity before it had a chance to get going.
To summarise so far: Web users are fucking idiots, web standards writers are fucking idiots, and Apple and Microsoft are fucking cunts. So, nothing really new then.
It is similarly unsurprising that web developers are also fucking idiots and cunts. There are a ridiculous number of web pages about video delivery which recommend the wrong fucking solution. Far too many shit-and-spunk-dripping arseholes publically exhort people to serve videos by using the HTML5 <video> tag with multiple <src> attributes - to waste tens or hundreds of megabytes per video of their valuable server space hosting the same bleeding content in both MP4 and WebM formats on the grounds that most browsers will be able to play at least one of them.
Er, HELLOOOOO??? Have you even fucking noticed that hard drives on your own machine and hard drives on a server are not the bleeding same thing? For sure hard drive storage on your own box is dirt cheap these days. You just buy a huge disk for peanuts and that's it. But it's a different matter on a server. Servers are rented, by and large, and the more storage you rent the more it costs. It costs more every month, not just once. It costs a lot more, since while hosting companies' standard server packages are often pleasantly cheap, once you start improving the spec beyond the base level you have to pay fuck loads for every little extra. And by far the largest consumer of storage on a web server is video content. Even one video can easily use more space than the whole of the rest of the site put together, and if you have lots of them... well, FUCK hosting all that lot in multiple different formats, fuck it sideways with a bog brush made of broken glass.
And why do they make this stupid recommendation? For... stupid reasons. They have some sort of religious attachment to the idea of "doing it all in HTML5". Even though HTML5 is a fucked up mess which plain isn't suitable. Even though it can easily double your hosting costs if you have to alter the base server spec to include a sodding massive disk to put it all on. Even though, as well, it involves you in the extra hassle of encoding into multiple formats, which may not cost any more but is still a pain in the arse to have to do. Pray do tell, exactly what is so fucking brilliant about HTML5 that makes it worth going to a fuck load of extra expense and hassle for no reason other than merely to avoid using anything else? ..... (deafening silence)
Let us be clear about this, by the way. HTML5 IS A LOAD OF FUCKING BOLLOCKS. There is only one potentially good thing about it - the <audio> and <video> plugin-free media tags - and they fucked that up by refusing to specify a codec so now it is fucking useless and they might as well not have bothered. The rest of it is just a mixture of different kinds of stupid bullshit. Support for transitions and animations and similar fucking annoying useless bollocks that we would be better off without any support for anywhere; to have them is merely to ensure that stupid cunts use them when what we should be doing is making bloody fucking sure they can't use them, ever. And actually writing stupid fuckwits' inability to code into the fucking standard so now the clueless benighted morons known as "web developers" have even less incentive to fucking learn about what they are fucking doing because their favourite stupid fuckups are now part of the standard. Any cunt who can even consider doing something like that should be disembowelled with a button hook. Meanwhile the things that always were genuine problems, such as vertical alignment and shrink-to-fit elements, are still just as much of a giant fucking pain in the cunt with HTML5/CSS3 as they were before. It has done precisely fuck all to solve the real problems and instead has created a horrible fucking mess in the name of helping moronic fucking idiots who can't fucking code and haven't got the faintest fucking clue about user interfaces to make even more massively useless shit than they were making before. HTML5 SHOULD NOT EXIST.
Fucksake. Fucking the job up so you can do it all with one shit tool is the WRONG WAY TO DO IT. The only time it is acceptable to modify the job to suit the tools is if no other tools are available. Where you do have a choice of tools, you choose the tools to suit the job. Not the other way round. And in this case we DO have a choice of tools.
Fuck using WebM to do a half-arsed job of filling the gaps at the expense of extra cost and hassle. It is unnecessary, pointless and stupid. All you need is ONE format - H264/AAC in MP4 - and adjust the delivery tools to suit the client. Which is piss easy, uses bugger all server resources, and only needs to be done once. Sure the format itself leaves something to be desired, but for a single format that works on everything you can't beat it.
The only devices where you need to use HTML5 video delivery are the abovementioned piece of shite Apple things. Everything else supports flash. And both flash and the crapple version of HTML5 will play H264/AAC in MP4. So that is the only format you need to host the videos in. One format for everything. No fucking about. Simple.
And it's dead easy to implement, because this is one instance where user-agent sniffing does not present the usual difficulties. Unless the user has been deliberately fucking about with their user-agent string - which doesn't count - you can rely on the user-agent string from a piece of shite Apple thing to have the name of the thing in it, whereas user-agent strings from other things do not have those names in. So it's a piece of piss - all you need is a simple regex...
if (preg_match('/\biP(hone|ad|od)\b/', $_SERVER['HTTP_USER_AGENT'])) { // generate HTML5 video tag code to play .mp4 video file } else { // generate flash player object code to play the same .mp4 video file }
...which works just fine, since nothing that isn't an i-shit tries to pretend it is one. And that's all you need to do.
Of course, you do also need to provide a direct download link to the video file, to cater for people whose device or connection is too bleeding slow to play videos straight off the web - and such slow connections are still distressingly common; even living in a city of an industrialised country and being less than half a mile from the exchange, mine is that shite, and so is everyone else's round here - and also for people who want to save a copy of the video so they can watch it again later (if on the other hand you are trying to stop people doing that, then you are a cunt). That, of course, just needs a bog standard <a> tag, and the appropriate content-disposition header sent.
Back to Crap Stuff
Back to Pigeon's Nest
Be kind to pigeons