Wednesday 30 May 2012

Overcoming the Demand 5 TV Catchup Performance Problem

Solving the Demand 5, Flash Movie problem - and other Catch Up TV website issues

If you are from the UK then you may often like to catch up on missed TV programmes by watching the online TV catch up services such as BBC iPlayer, Channel Four's 4OD and Channel 5's TV Catch Up service called Demand 5.

The past few nights I have been trying to catch up on a number of programmes shown on Channel 5 as for some reason Five Star has stopped showing the latest episode of Burn Notice on a Sunday afternoon and I like to watch other shows (when they are available) like NCIS and The Mentalist etc so I try to use Channel 5's catch up website Demand 5.

I really wish they would buy the rights to show for longer so that you could watch a programme for more than just 7 days but then it's not called catchup TV for nothing and most TV programmes are made in the USA.

However when I use the Demand 5 website to watch the programme I experience a very annoying problem which effects every browser and computer I tried using including Chrome, FireFox, Safari and IE 8 on a Sony Vaio Windows XP 32 bit Dual Core and IE 9 on a Dell Windows 7 64 bit Quad core.

The Demand 5 catchup TV problem means that pre-show adverts play fine and then after a period of anything between a few seconds and a couple of minutes of the actual show playing the Demand 5 Catchup TV programme would either just freeze up and not start playing again at all. 

Or it would play for a while before stopping for a few seconds as if it was buffering more content before playing for another few seconds again - totally unwatchable.

I couldn't even move the skip bar backwards or forward and the pause / play button just didn't work at all.

A refresh would reload the page, show the adverts before the programme again and then the problem would re-occur. It was all very annoying..

After a number of seemingly ignored comments to Demand 5 complaining about them not fixing the problem and after reading on almost every show on the site that a large number of other people have had similar problems I tried solving the issue myself.

If you go to any show on Demand 5 and read the comments at the bottom e.g you will see comments along the following lines.

"Really poor transmission of episode 23. Can't get more than 20 seconds of coherent dialogue and then it freezes"
"Impossible to watch because of the poor service from Demand Five's website. Even worse than Karen's experience."
"Why is demand 5 not working? It hasn't worked for several weeks. You don't get this with iplayer!!!"
"doesnt seem to be able to play anything"
"wow the longest i got to watch before it froze was 50sec. i did give up 5min in though. I'm with sue off to iplayer which works."
And those are just a snapshot of the many comments on a couple of shows I wanted to watch today all complaining about the Demand 5 website video freezing or not playing at all. 

Demand 5 really need to fix this problem if they want to keep visitors coming to the site.

Due to my own comments and complaints not being answered I tried fixing the problem with Demand Five freezing myself - only because I really wanted to watch the latest episode of NCIS.

I wasn't going to step through all their custom JavaScript and I have no idea what they are doing server side so proper debugging is out of the question but what you can do in situations like this is turn everything else off and then back on again one by one to see if any section of the browser or website is causing the problem.

So without knowing whether they are running some client side code constantly that rewrites the DOM such as many sites try to use to beat all the plugins that are designed to hide adverts, images and flash I could try to see if turning off those parts of the site helped as they maybe running code to constantly re-insert adverts into the HTML to replace any removed by plugins like AdBlocker.

If they were doing something like this (and I don't know if the are) then it's possible that a race condition might occur between Demand 5's own advertising code and any any plugins or virus checkers (which have built in anti-banner options) that constantly scan and rebuild the DOM.Only proper debugging will prove if that is happening,

Debgging the Demand 5 website Performance Problem

So to get a fix for the the Demand 5 problem as soon as possible the first thing I did were all the normal things that developers try when met with similar issues. If you find similar problems on other sites or with plugins for websites you should always try this list first to rule them out as reasons for the problem.
  • Disabling all cookies - the Web Developer Toolbar in Firefox is great for this and if you are not signing into the website there is no need for cookies to be enabled anyway.
  • Disabling Java - Most websites don't even use Java Applets any-more so its not really needed until you find a site that actually makes use of it.
  • Disabling JavaScript - Most websites that show TV content actually require JavaScript to be enabled for their site to work at all even though a basic Flash OBJECT or VIDEO element on a page outputted with server side code playing a movie doesn't require it. However companies like Demand 5 or iPlayer don't do this because it mean their content can easily be stolen or watched overseas by non UK citizens etc so JavaScript is actually required to load in the adverts and programming in chunks.
  • Turn off all Flash tracking by disabling Flash cookies. You do this by right clicking on a flash movie, click the Global Settings option and then choose "Block all sites from storing information on this". Unless you really want another way for advertisers and websites to track your online movements there is little need for this option to be enabled. You may want to check your video and microphone options as well.

Even after all this the Demand 5 flash videos were still having problems playing and although the options I just disabled are worth doing anyway to prevent online tracking by advertisers it didn't fix the Demand 5 TV catch up problem.

Flash is a well known CPU killer on websites and I have seen whole PC's crash due to one to many flash object on a web page being left open too long. Just open a page with a few flash movies and watch the CPU rise in your task manager if you want proof - Chrome seems particularly bad for this but despite this many sites continue to try and write their whole website in Flash which is a BAD IDEA!

However I did notice that the page that held the movie also contained a large number of other banner adverts that used both flash and animated gifs and I wondered whether there was some sort of problem occurring due to all the techniques advertisers now use to try and overcome advert blockers.

Basically websites or plugins use a timer to re-insert banners that have been removed from the HTML DOM by advert blocking plugins like AdBlocker which also uses a timer to remove any adverts re-inserted this way. Both sets of code doing the opposite to each other every split second - not good for performance!

Because both the advertiser and blocker are using the same methods to scan and modify the DOM constantly it basically turns it into one big performance nightmare in which your DOM is constantly being re-written on the fly. The less client code that runs the better KISS IT (Keep It Simple Stupid) for a multitude of reasons.

The Fix for the Demand 5 website Performance Problem

I opened Firefox and went to install a plugin I use on my other computer called Flash Blocker but I noticed a new plugin had been released called Image and Flash Blocker 0.7. I thought I would try it out.

At first I thought something hadn't loaded as I couldn't see any options under my Tools menu however you need to use the context menu (right click the mouse button) to use the add-on and see the various options.

Choose "Image and Flash Blocker" from the context menu and then select "Images off, Flash off" and hey presto most of the imagery, banner adverts, flash banners and movies disappear.In fact most of the Demand 5 page is blank without these features enabled.

The flash movies are replaced with a little red circle with a white "F" (for Flash) in the middle and if you want that particular flash movie to appear you just click it.

I turned every image and flash movie off on the latest episode of the show I wanted to watch e.g Burn Notice, NCIS, Archer, The Mentalist etc, and then I clicked the main movie screen to turn the video back on.

When the adverts had finished playing the TV show played without a single stall, stoppage or flicker. Hey presto problem solved! Big slap on the back for moi.

Remember - too much whizz bangery can cause performance issues

Remember images, Applets, Active-x objects, Flash and all the other fancy whizz bangery that comes with HTML 5, CSS 3 and modern JavaScript libraries is all well and good but more often that not it can cause a massive performance overhead on your computer. The best tactic is to turn it all off and then only turn on what you need once you know you need it and the clients browser supports it.

In the case of fixing Demand 5 catch-up TV it was definitely a case of less the better as it seemed that too much was going on behind the scenes to allow their TV shows to play smoothly. What exactly is happening I don't know without access to their source code but this is definitely a workaround for the Demand 5 performance problem that works!

Hopefully this blog article will help others overcome the same problem. I have tried writing comments with a link to this article on most of the shows I watch as they all contain similar complaints but for some reason they don't like the fact I put a link into my comment or try to help people solve their own technical issues.

So if you watch Demand 5 and have performance problems remember - turn off images and flash and then turn on the only flash movie you need - the TV programme you are trying to watch and then enjoy it without any flickering or stopping every 20 seconds.


David Smith said...

Thanks a lot that really helped me out. I wanted to watch an episode of NCIS but it kept stopping after a minute.

After installing that plugin and doing what you said it played perfectly.

Thanks a lot

Anonymous said...

Great help.

Really sorted my problems out. I was going to walk away from Demand 5 and get a TV disk recorder but now I can watch Demand 5! Wicked!

Ben Phillips said...

Nice one.

Cheers for putting those search terms up on Demand 5 to find your blog. Don't know why they would strip a link out designed to help people watch their own shows. They must be losing shit loads of viewers AND advertising revenue from people giving up and leaving the site due to their rubbish TV player.

Your advice really helped me out.


Lee Cooper said...

Thanks for this advice - worked a treat! Keep up the good work.

Anonymous said...

Thanks for this - really helped me out. Now I can watch CSI without it stopping every 10 seconds!

Anonymous said...

Thanks for the post - works really well. It actually makes Demand 5 useful!

Kelly Williams said...

Thanks a lot for this now I can watch my fav shows on Demand 5 without it flickering and hanging all the time!

Channel 5 should hire you to fix their bugs as you obviously know more than they do.

Your great man keep it up!

Anonymous said...

Thank you for advice...

hisnameisrob said...

Thanks, demand five now works pretty well for me where it was totally unusable. Some programmes now play perfectly immediately and without adverts, but others only play after the ads and do pause for 20 seconds before they play (but playback is then smooth).

Euan said...

Fantastic. Thanks for the heads up. I've just watched Person Of Interest without irritating hangs and stuttering.

mrdaviesphysics said...

Great information, thanks.
Alas, no Firefox for iPads, as far as I can make out, so have been unable to watch Demand 5 successfully.
Can anyone suggest a similar workaround for ipad users, please?
Many thanks


Anonymous said...

The Demand 5 website won't work for video playback on an iPad as Apple don't support Flash. But there is a native Demand 5 app in the app store so why not download that?

Rob Reid said...

Because you might be on a PC? Or another device? I know there is an app you can download the problem was with their standard webpage and the code they were using. I have not complained about any app they may have wrote to get round it. I just wish all these TV catchup companies could write their webpages in HTML5 using VIDEO tags so even without SMART TV apps I could use the TV web browser to watch their catchup programmes.

A Peppermint Penguin said...

You're a genius! thanks.

Rob Reid said...

Please remember all Demand5 code will be changing all the time.

So keep abreast of the latest plugins. View the generated source (not page source when the HTML loads)

Always turn images/flash off when the page loads and then just turn on the flash movie of the film you want to watch.

AdBlocker code and code preventing blocking loops constantly looking for new JS/Flash put back into the DOM or removed from it and then puts it back OR removes it again. This kills CPU - check your task manager on this page.

Do anything you can to reduce CPU, turn off anti-virus, turn off plugins and add-ons in the browser, turn off anything that could run constantly like Firebug / Console.

The less code running the better. I don't know why some people can get it to work but others can't you would have to put two computers side by sidevto debug.

Turn off as much JS and browser guff as possible.

Then try it.

Gary said...

I have this issue on the PS3 as you say a buffering type pause sometimes no problems and others just impossible to watch
There is no update available
I hate the fact there is no helpful suppot from Sony (that I am aware of)

Anonymous said...

In response to Anonymous 27 Sept 2013, the demand 5 app doesn't work at all onmy iPad - I've installed it but, when I tap on it, it flashes to full screen for a second and then reverts to the app icon. Hopeless!

Rob Reid said...

No surprise considering iPads (as far as I am aware) don't support flash and the demand 5 code uses flash to play their videos.

Why they cannot rewrite their page to use HTML 5 VIDEO tags with direct links to mp4 files or flash as a last dirty resort I don't know.

I guess the only choice is to write one of another million complaints and pissed off comments underneath all the shows.

The more then better!!

Hannah said...

This has made the problem slightly better for me but it still freezes 3 or 4 times during a 25 minute programme. Is there anyone else for whom this hasn't fixed the problem? Any other ideas? I'm on the verge of giving up on Channel 5 altogether.

Rob Reid said...

Channel 5 actually told me (by email) that they had "fixed" the problem.

I pointed out some recent comments from popular TV shows like NCIS, Mentalist etc and the people still complaining but I got no response. They thought it was nothing to do with race conditions between their advert "implanter" code and any advert "blocker" code.

I still find turning off all images, banners and flash with a plugin then turning on JUST the TV screen works for me.

You may have to try a different browser like FireFox/Chrome/IE/Safari and see if one works better for you as they all have different JS engines and depending on your PC 32/64 bit, OS and Browser + the website - the combo could all make a difference.

Unknown said...

an easy hack trick - if u struggle to play a video oon catch up tv - play a different program on same channel - as soon as its running switch - hey presto have fb too

Rob Reid said...

Hi Laura

I think this isn't a problem with CatchupTV e.g SmartTV / YouTV etc but on the 5 on Demand website.

So if you cannot get ANY videos playing I don't know how you can then switch to another one. This was the issue I and many others had e.g no videos would play on a computer / laptop at all.


Anonymous said...

They seem to have decided to just do away with the comments section on This years big brother. After several years of the same complaint that was their idea of what needed sorting out. Head in sand is never a good approach. I haven't tried to watch anything on demand 5 for these very reasons and thought I'd give it a go coz a cousin of a friend is in BB. I guess I shouldn't have dared imagine they would try sort it. I am actually catching up several weeks after it has aired so it's not likely to be a busy server issue.

izrr said...

Hi. I have the same problem with Talktalk Youview. All the channels work well apart from Demand 5. Anyone knows how to work around this issue for Demand 5? Thanks

Anonymous said...

Trying to watch person of interest, no chance firefox keeps crashing i tried the workaround but when i click the white f in the red circle nothing happens,channel 5 this is garbage sort this crap out i'm going back to iplayer at least it works !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Rob Reid said...

Have you tried another browser e.g the latest versions of IE or Chrome, I just tried there new My5 site on my PC and it played ok in Chrome, no adverts on the page either. So they have redesigned the whole site since I wrote this article as it used to me Demand5 now its My5.

I'm not sure whether you are trying to watch it on a PC, tablet or phone but I have found even on smart TVs and tablets/phones that Demand5 often fails to work like the other apps iPlayer itv etc.

I notice when I play it on my PC my performance (in task manager) is up and down like a heart monitor, so the CPU/Memory being used is obviously high.

Therefore if you are now talking about "My5" and not demand5 (e.g on your PC) try disabling all plugins in Firefox and try to watch it if you cannot watch it in Chrome or IE.

Also when it's running open TaskManager and see in the processes window whether there is a process consuming lots of CPU or Memory (click the tabs at the top to order by each column) you may find some "player" app is running at high CPU/Memory e.g FlashContainer, FlashPlugin etc

I know some browsers are stopping support for Flash due to bugs/security holes etc but make sure you have the latest version of flash on your PC (go to their site to do the check).

Hope this helps

TonyM said...

My5 is the only program/site that completely crashes my PC (Windows 10, 64 bit). It's done it 4 times now, at some random point during the programme the PC will freeze, one screen becomes a primary colour and the other black. Requires switching off at the wall and rebooting.


I haven't had any other crash of any sort since upgrading to Windows 10 - it's been rock solid 8 hrs+ a day for working from home as a programmer on the machine. Apart from My5 causing those catastrophic failures!

I'm using Chrome so might try another browser as I'm getting sick of it!

Rob Reid said...

Try and do a Trace Route in the command line to see if there a server along the way causing dropped packets or long delays.

I managed 15 hops to (command prompt > tracert

Also you could try a brand new fresh install of Chrome, no extensions or plugins, just ensure no 3rd party cookies are enabled, try that.]

Still got issues then download a plugin called "uBlock Origin" which will block 3rd party scripts being downloaded, images and content that is too large to be loaded and other objects. You can of course turn it off/on on a per site basis but it might help to know if 3rd party trackers, web-bugs, images and so on are taking a long time to load that without them it could run quickly.

If you still cannot My5 to run on your tablet without crashing email the company as that's what I did and you should get some support to try and help you find out what the issue is.