0

This appears to be an ongoing issue and I've sought a solution a couple of times now to no avail. Chrome has limits on the number of connections it can have open so if you visit a page that has a large video then navigate back and forth to another page 7 times it will hang your application.

This is a bug that has been active in chrome for years now and the only solution is to somehow set any HTTP requests that are pending to abort but I can't figure that out at all. Has anyone got any idea how to accomplish this in NG2

I've tried setting the src to empty in ngOnDestroy and adding dynamic timestamps to the end of the file names but nothing works. I need some smart way to actually destroy http requests that are pending when you navigate to a new view or just destroy previous views media requests

These are static elements hard coded into the pages HTML so cancelling service subscriptions won't work.

Kravitz
  • 2,087
  • 5
  • 22
  • 41
  • Please make it more prominent that this are HTTP requests made by the browser because of static HTML (`src="..."). Ideally add the HTML. – Günter Zöchbauer Jun 14 '16 at 06:58
  • No problem, I've done that now. It's a basic HTML video tag with MP4 and webm formats with preload=none and autoplay=true options. I've seen things about pendingRequests in angular one but can't seem to find any similar function in ng2 – Kravitz Jun 14 '16 at 07:02
  • In relation to the comment you deleted Gunter. Can I pull in the videos by a subscription append them to src and then ondestroy kill that subscription. Would that solve my issue ? If so could you please repost that comment – Kravitz Jun 14 '16 at 07:56
  • Have you tried wrapping the video with an ` – Günter Zöchbauer Jun 14 '16 at 08:06
  • It's not really the clean solution I was looking for and it must be a video element as I am outputting the video onto a HTML canvas at the same time – Kravitz Jun 14 '16 at 10:04
  • As it is a Chrome bug and no custom code is involved I wouldn't expect a clean solution to be available. – Günter Zöchbauer Jun 14 '16 at 10:12

0 Answers0