Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VideoLoadOptions.loadData does not work #268

Open
mnordine opened this issue Feb 23, 2017 · 8 comments
Open

VideoLoadOptions.loadData does not work #268

mnordine opened this issue Feb 23, 2017 · 8 comments

Comments

@mnordine
Copy link
Contributor

mnordine commented Feb 23, 2017

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.

@bp74
Copy link
Owner

bp74 commented Feb 24, 2017

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 :)

@mnordine
Copy link
Contributor Author

Absolutely, will do

@bp74
Copy link
Owner

bp74 commented Feb 26, 2017

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/fun_select@1x.mp4', 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.

@mnordine
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@bp74
Copy link
Owner

bp74 commented Feb 27, 2017

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?

@mnordine
Copy link
Contributor Author

mnordine commented Mar 1, 2017

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.

@bp74
Copy link
Owner

bp74 commented Mar 1, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants