last day (14 days later) » 

5:40 PM
0
A: Loading a video file without input upload

guest271314 How to create an objectURL directly from a local path? You can use XMLHttpRequest with responseType set to "blob". File inherits from Blob, you can pass returned Blob to your existing function which expects File object. See also Loading images from file with Javascript var request = new XML...

 
Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
 
@JeanmichelCote Which browsers have you tried javascript at Answer? Have you read linked Question/Answer?
 
Sorry, I am not sure what you mean...
 
Try closing chrome, then launching with --allow-file-access-from-files flag set. See askubuntu.com/questions/160245/…
 
Oh yes, I did that. But It didn't change the result.
 
5:40 PM
Did you close all open instances of chrome? Or only the tab? Are you trying to load a file from file: protocol at an origin other than file: protocol?
 
I have quit entirely. Loading from file://. Also tried loading "localhost:3000/path/from/app/to/myfile.mp4"
 
"I have quit entirely." What do you mean?
 
Quit chrome. command Q
 
localhost is not file: protocol.
 
Tried both. None worked. My code may be bad somewhere else. I may just end up using node's fs...
 
5:40 PM
Is the document which you are trying to load from file: protocol at file: protocol, or localhost?
 
I am running a React app on my local machine in dev mode with webpack so the video file is on my local filesystem and within localhost.
 
Then why are you trying to use file: protocol at localhost?
 
tried file:// with the full path, localhost with relative path. None worked...
 
Is the file in the same folder where document is loaded at localhost?
 
It is in a subfolder but I think the relative path is right. When I try to simple load the file from the relative path, without xhr, without blobbing, it says: This video file format is not supported.
if I blob the file:
This video file format is not supported.
 
Well, doesn't smell good. Thanks, I'll see what I can do.
 
See stackoverflow.com/questions/38536000/… . The linked jsfiddle loads an .mp4 video
 

last day (14 days later) »