0 Favourites

javascript error when playing mp4 file

  • Problem Description

    when trying to play a video using the included "video" plugin an error occure :-

    Javascript error!

    SecurityError: The operation is insecure.

    localhost/glwrap.js, line 1631 (col 0)

    This is likely a bug in Construct 2 or a third party plugin or behavior - please report it to the developer. Subsequent errors will be logged to the console.

    Attach a Capx

    uploaded

    Description of Capx

    just play a video from mp4 source online

    Steps to Reproduce Bug

      just a simple code to play mp4 from online source uploaded to my domain host.

    Observed Result

    javascript error and only the audio is playing with no video

    Expected Result

    video plays normally

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (unknown)

    Operating System and Service Pack

    win7 64bit sp1 up to date

    Construct 2 Version ID

    r173

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Egyptoon

    I don't see how this is a bug, going by the manual. You are referencing a url instead of a project file and the manual specifically states:

    [quote:29avwyvm]You must encode your video files yourself, and then import them as project files.

    https://www.scirra.com/manual/181/video

    Unless this has changed, then the manual says it must be imported before it can be played.

  • thanks for your reply, can you please tell me the steps in details ? how can i import the mp4 file and how to input its "source" ? is that a web address?

    thanks for help

  • I've fixed the error for the next build, so it simply logs to the browser console instead of bringing up that popup. However it still won't work, because you are loading a video from a different domain (). Cross-domain security limitations prevent you being able to load video from different domains if they do not allow it. The egyptoon.net server would need to send the Access-Control-Allow-Origin HTTP header to explicitly allow this.

    Alternatively just download the video file and import it as a project file, and then it can play since it's on the same domain.

  • it worked! thanks alot, i just put the file name with the extension "v1.mp4" (file name only doesn't work) as the source after importing it as a project file and it works.

    thanks alot for your great help

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