javascript error when playing mp4 file

Bugs will be moved here once resolved.

Post » Thu Aug 21, 2014 10:52 pm

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

Javascript error!
SecurityError: The operation is insecure.
http://localhost:50000/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
You do not have the required permissions to view the files attached to this post.
B
15
S
5
Posts: 192
Reputation: 1,514

Post » Fri Aug 22, 2014 7:50 am

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

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.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
84
Posts: 5,384
Reputation: 58,450

Post » Fri Aug 22, 2014 12:41 pm

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
B
15
S
5
Posts: 192
Reputation: 1,514

Post » Fri Aug 22, 2014 12:50 pm

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 (http://egyptoon.net/v1.mp4). 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.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Fri Aug 22, 2014 12:56 pm

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
B
15
S
5
Posts: 192
Reputation: 1,514


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests