Video Needs Access-Control-Allow-Origin just for preview?

0 favourites
  • 13 posts
From the Asset Store
Add SubRip (SRT) subtitles to your videos in Construct 3
  • I thought the CORS policy would only be relevant if using an external sever to pull in data, am I mistaken?

    I simply want to play a video using the sources from the project's video folder:

  • Ashley

    Doubt this is a bug and more so something wonky with my specific setup since no one else seems to be talking about it.

    Any idea why I'd need to modify CORS policy just to play a video from a video source within the project itself?

  • No idea if my bug is similar to yours...

    but I am having trouble using my Ajax...

  • I just verifyed that my console.log is presenting me the same bug as yours...

  • I believe this is due to the nature of the construct 3 preview mechanisms, once exported and installed/hosted, they work.

  • No idea if my bug is similar to yours...

    but I am having trouble using my Ajax...

    If your using PHP pages, you likely need to add:

    header("Access-Control-Allow-Origin: *");

    header("Access-Control-Allow-Headers: *");

    At the top of the php pages.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • still doesnt work....

  • I believe this is due to the nature of the construct 3 preview mechanisms, once exported and installed/hosted, they work.

    I figured this might be the case so I exported to Windows and no video showed (Set to autoplay). Unfortunately I can't check for errors on such an export.

    I'll test again just in case I missed something.

    However, if it as you mention, this should at the very least be stated in the manual (unless I missed its presence), and at best, some sort of workaround should be available so that an individual doesn't have to constantly export their project just to see how their videos are setup.

  • No idea if my bug is similar to yours...

    but I am having trouble using my Ajax...

    I use AJAX and it works, however, I'm just sending data from the project itself rather than an external source. Not sure how you have yours setup.

  • For the video, could you test if this c3p file with short video works for you ?

    dropbox.com/s/9jcudxhijmjls3u/video_test.c3p

  • This doesn't look like it's actually anything to do with CORS. It looks like it is trying to load the video from the wrong URL in preview mode.

    It might be related to a server-side change we made a few weeks ago for a beta release. Try clearing your browser cache and try again.

    Other than that, we'd need all the same details as a bug report to be able to investigate.

  • For the video, could you test if this c3p file with short video works for you ?

    https://www.dropbox.com/s/9jcudxhijmjls3u/video_test.c3p?dl=1

    It works, turns out this is simply an issue of needing to add the file extension .mp4,.webm to the file names.

    So this works a bit differently then sounds where you only need the file name and not the extension. Good to know.

    Thanks lennaert!

  • > For the video, could you test if this c3p file with short video works for you ?

    >

    > dropbox.com/s/9jcudxhijmjls3u/video_test.c3p

    It works, turns out this is simply an issue of needing to add the file extension .mp4,.webm to the file names.

    So this works a bit differently then sounds where you only need the file name and not the extension. Good to know.

    Thanks lennaert!

    Very good !

    Perhaps it could be handy if the fields for filenames gets a selection from a (drop down) list. Like various other elements have, so small mistakes like these can't occur.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)