0

I'm trying to load images from http://admin:1234@192.168.8.112/ on my local network

Here are iOS and android screenshots from the emulators respectively

enter image description here /Users/riaz/Desktop/screenshots/Simulator Screen Shot - iPhone XS Max - 2018-10-17 at 13.43.27.png

For some reason the images only show up on iOS and not on android.

Here is the relevant typescript code

   this.cameras = ["http://admin:1234@192.168.8.112/video1.mjpg","http://admin:1234@192.168.8.112/video2.mjpg","http://admin:1234@192.168.8.112/video3.mjpg" ]

and the relevant html code

    <ion-grid> 
    <ion-row>
        <ion-col col-6 col-md-4 col-xl-3 *ngFor="let item of cameras; let id = index">
            <div align="center" style="flex-wrap: wrap" class="camera">
                <img [src]="item" #imageToView (click)="presentProfileModal(item)" />                   


                <p id="text" text-wrap >Camera {{id + 1}}</p>
            </div>
        </ion-col>
    </ion-row>
</ion-grid>

I've tried using iframes instead of img tags as well as sanitising the URL's with domsanitizer to no avail.

any help or pointers in the right direction would be highly appreciated

Riazbapoo
  • 61
  • 5
  • is there any error? what do you see in "elements" if inspected using chrome? – Sergey Rudenko Oct 17 '18 at 17:16
  • @SergeyRudenko I usually use "ionic serve" in safari. tried for the first time in chrome now and saw this warning "[Deprecation] Subresource requests whose URLs contain embedded credentials (e.g. `https://user:pass@host/`) are blocked. See https://www.chromestatus.com/feature/5669008342777856 for more details. " – Riazbapoo Oct 17 '18 at 20:44
  • so;) do you know now what to do with it or you still need help? – Sergey Rudenko Oct 17 '18 at 22:35
  • @SergeyRudenko I still need help haha. I don't know how to bypass this ... any suggestions ? I am facing the exact same problem as this person https://twitter.com/oliverh57/status/902834059801485312?s=21 – Riazbapoo Oct 17 '18 at 22:57
  • I think you should implement access using headers: https://en.wikipedia.org/wiki/Basic_access_authentication - have you tried this? Basically when you pass login - password as part of URL the way you have your browser (if it supports this schema) sends those credentials in a second request as headers. So you should try do that. Let me know if you struggle with this I will draft you something. I just can't validate this unfortunately. – Sergey Rudenko Oct 17 '18 at 23:22

0 Answers0