1

The problem I'm having is that when I use Chrome, Firefox or any Android browser, images or videos displays correctly but on Safari (iOS, I don't tested it on Mac OS Safari) videos loading as a transmission. My code which works properly on the browsers I tested but no on iOS Safari is:

import {Request, Response} from "express";

const fetch = require('node-fetch');

class MediaController {

    static getMedia = async (req: Request, res: Response) => {
        try {
            const response = await fetch(req.query.url)
            response.body.pipe(res)
        } catch (e) {
            console.log(e)
            res.statusSend(415)
        }
    }
}

export default MediaController;

I'm doing this to avoid CORS.

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
yulof
  • 11
  • 3

0 Answers0