StageXL icon indicating copy to clipboard operation
StageXL copied to clipboard

VideoLoadOptions.loadData does not work

Open mnordine opened this issue 8 years ago • 8 comments
trafficstars

The following does not seem to work:

final videoOptions = StageXL.videoLoadOptions.clone()..loadData = true;

resources.addVideo('blah', 'videos/blah.mp4', videoOptions);

When I run this code in Chrome (after dart2js), and look at the network tab in Chrome Dev Tools, I see that it attempts to load the mp4, webm, and finally ogg versions. I have mp4 and webm versions on the web server, and they transfer over the network fine. It seems an error occurs when they are then loaded as blobs, then they continue with the fallbacks.

mnordine avatar Feb 23 '17 19:02 mnordine

Interesting, i will take a look at it! If the videos are small enough, you could send them by mail. This way i don't have to search for videos myself :)

bp74 avatar Feb 24 '17 09:02 bp74

Absolutely, will do

mnordine avatar Feb 24 '17 13:02 mnordine

Hi, I have tried this and for me it looks fine. I don't see that the webm or ogg file is loaded. Only the mp4 file is loaded. This is my test:

http://www.stagexl.org/temp/blobload/example.html

  var resources = new ResourceManager();
  var videoOptions = StageXL.videoLoadOptions.clone()..loadData = true;
  resources.addVideo('blah', 'videos/[email protected]', videoOptions);
  await resources.load();
  var video = resources.getVideo("blah");

capture

Maybe it has something to do with the content-type of the file? For the mp4 file it should be "video/mp4". You can verify this with a tool like Fiddler (if you are using Windows). The easiest test is to try my sample and see if this one works for you.

bp74 avatar Feb 26 '17 09:02 bp74

Very odd, I've tried with 2 different web servers, Nginx and Google Cloud Storage, and they both return content-type video/mp4. It's like I'm getting the same result as you, but the data:video/mp4 is failing for some reason.

mnordine avatar Feb 27 '17 01:02 mnordine

The funny thing is, when I click your link and watch network tab, I don't see the data:video/mp4 request

mnordine avatar Feb 27 '17 01:02 mnordine

Yes i was wondering about the data:video/mp4 request too. I saw it when i made the screenshot and on the next request it was gone. I restarted the browser and cleared the cache, sometimes the data:video/mp4 request is shown and sometimes it is not. I don't know why.

Anyhow, we can only see the video/mp4 request to the web server. The question is still what is different from my example to your application. Maybe i can try with the original urls from your web server? Btw. what operation system and which browser are you using?

bp74 avatar Feb 27 '17 09:02 bp74

Sorry for late reply. Still not sure what's going on. I've tried on many different combinations, Chrome, FF, both on Windows and MacOS. Safari on MacOS.

mnordine avatar Mar 01 '17 18:03 mnordine

So you still have the problem with your application, but my sample works fine? Could you send me the links to the video files on your server? I could try to load the files directly from your server.

bp74 avatar Mar 01 '17 19:03 bp74