I am trying to develop a small application in which I first capture the screen through a package apertureand then try to display it on the screen using a tag video.
I take a screen through:
import apertureConstructor from 'aperture';
const aperture = apertureConstructor();
const options = {
fps: 30
};
(async () => {
await aperture.startRecording(options);
setTimeout(async () => {
this.captureUrl = await aperture.stopRecording();
}, 3000)
})();
Please ignore the clutter. aperturethe package writes the captured video to disk, and in the end I have a path to this file in captureUrl. This is something like this:
/var/folders/29/08gshk3n4mlbbcjnm1m5xyy40000gp/T/tmp-79999m0uOszQK0zaC.mp4
I can verify that this file exists and plays perfectly if I type: file:///var/folders/29/08gshk3n4mlbbcjnm1m5xyy40000gp/T/tmp-79999m0uOszQK0zaC.mp4into the address bar of Google Chrome.
Therefore, I am trying to use this address as the source of the tag videoas follows:
<video control autoplay>
<source src="/var/folders/29/08gshk3n4mlbbcjnm1m5xyy40000gp/T/tmp-8004145a2o4gugbVV.mp4" type="video/mp4">
</video>
Which complains that there is no file (404):
GET http://localhost:9080/var/folders/29/08gshk3n4mlbbcjnm1m5xyy40000gp/T/tmp-8004145a2o4gugbVV.mp4 404 (Not Found)
, localhost:9080, , .
, file://...
<video controls autoplay>
<source src="file:///var/folders/29/08gshk3n4mlbbcjnm1m5xyy40000gp/T/tmp-8004145a2o4gugbVV.mp4" type="video/mp4">
</video>
:
Not allowed to load local resource: file:///var/folders/29/08gshk3n4mlbbcjnm1m5xyy40000gp/T/tmp-80041e3SlBZUNphLM.mp4
:/
, -, "://" - .
"fs" base64, data:, , , .
electron , - . . !