User Media Snapshot Data causes 15 sec jank

Bugs will be moved here once resolved.

Post » Fri Dec 02, 2016 11:30 am

Problem Description
Loading a small sprite image from UserMedia.SnapshotURL is very quick. However, any attempt to save the data in text format causes a game to hang / jank and is, consequently, unusable for storing snapshot images as data.

When I copy the in-browser / Inspect Element / Sources / sprite-default-000.png as a data URI it takes approx 1 sec to obtain the data string, hence why I consider this to be a bug in c2.

Attach a Capx
capx

Description of Capx
The UserMedia object is used to transfer a snapshot to a data string or image, depending on your selection.

Steps to Reproduce Bug
  • Snapshot to sprite, observe (no discernible) delay.
  • Snapshot to text, put the kettle on....

Observed Result
There is no delay when transferring image data from the SnapshotURL to a sprite, but there is approx 15 seconds (in Chrome) of hang-up on my i5 laptop when transferring the data string to a text object.

Expected Result
Converting an image to a data string should not cause a game to freeze.

Affected Browsers
  • Chrome: (YES)
  • FireFox: (YES)
  • Edge: (YES)

Operating System and Service Pack
W10 x64.

Construct 2 Version ID
r240 64 bit.
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,205
Reputation: 43,832

Post » Tue Dec 20, 2016 6:59 pm

I think the slow thing is just the text layout. If you set the snapshot URL to a text instance variable, for example, it's perfectly fast. The slow thing is running text layout (word wrap etc.) on a huge block of unnatural text. I'm not sure there's much we can do about that. One easy workaround is just to display the first 300 characters or something if you want to show it to the user.
Scirra Founder
B
395
S
231
G
88
Posts: 24,367
Reputation: 193,694

Post » Tue Dec 20, 2016 7:13 pm

@Ashley - thanks. I must confess that I thought I was recreating a bug that was causing mobile browsers to crash when adding the data string to a dictionary object (the jank was so long it was breaking the multiplayer connection). I'm not sure how to reproduce it another way...
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,205
Reputation: 43,832


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests