1

I'm trying to get a live image from a camera using basic authentication in the url string.

To confirm that this works, writing something like the below into the browser works:

http://user:password@ipaddress/path-to-live-stream

But if I put the same url into the 's src attribute:

<img src="http://user:password@ipaddress/path-to-live-stream" />

This, however, does not work.

Even if this is by design or not, how can I make this work? How can I use basic url authentication to get a live stream or image from any source?

Espen
  • 3,607
  • 11
  • 48
  • 75
  • 1
    [Related question](http://stackoverflow.com/questions/5858936/html5-live-streaming) (I think). – Mosh Feu Oct 06 '16 at 07:23
  • 1
    @MoshFeu: I need help with authentication. The stream itself works great using the tag. – Espen Oct 06 '16 at 07:28
  • 1
    can you give us a valid test values for user, password & ip to test ? May be you could ping me separately if you want – Nikhil Nanjappa Oct 06 '16 at 08:07
  • 1
    I found a similar question here http://stackoverflow.com/questions/3823357/how-to-set-the-img-tag-with-basic-authentication – Nikhil Nanjappa Oct 06 '16 at 08:12
  • 1
    For a PHP based solution refer - http://stackoverflow.com/questions/24042994/how-to-show-an-image-which-is-secured-by-http-authentication – Nikhil Nanjappa Oct 06 '16 at 08:14
  • @NikhilNanjappa: Sorry cannot give you anything to test on as these cameras are on a private network. I might try to do some pre-loading or whatever using JavaScript so that the browser is already authenticated when loading the tags... – Espen Oct 06 '16 at 08:28
  • Ok, did you manage to read the links I gave above? – Nikhil Nanjappa Oct 06 '16 at 09:13
  • @NikhilNanjappa: I did :-) I will probably go for server side loading using mvc. I was just hoping it could be done a bit simpler. Thanks! – Espen Oct 07 '16 at 07:19

0 Answers0