Streaming video to a browser / CORS issues

Want to write your own code to work with a HDHomeRun or work with the HDHomeRun DVR? We are happy to help with concepts, APIs, best practices.
Posts: 1
Joined: Tue Aug 28, 2018 2:27 am

Streaming video to a browser / CORS issues

Postby supersat » Tue Aug 28, 2018 2:43 am

I've been starting to experiment with streaming video from my HDHomeRun EXTEND to my browser. Since browsers typically don't support H.262 or AC3, I've configured my HDHomeRun to transcode video to H.264, although it appears I'll need to transcode the audio myself. I can retrieve a list of local devices and pull down channel lineups with XMLHttpRequest. I was planning on using the newer fetch()/ReadableStream browser APIs to actually pull down the video, send it through mux.js to split out the H.264 and AC3 streams, transcode the AC3 stream in JavaScript, and push the resulting streams to a <video> element with the Media Source Extensions API.

However, the one wrinkle in this plan is that unlike the JSON files, the HDHomeRun does not send an Access-Control-Allow-Origin header, which prevents me from consuming the byte stream from JavaScript. Is there any way to work around this? I suppose for testing I could proxy requests to the HDHomeRun through a local server which either serves up the web app or adds the CORS headers, but I'd really like this to work on anyone's network without any additional setup.

Return to “Development Support”

Who is online

Users browsing this forum: No registered users and 1 guest