Video SetPlaybackTime causes Javascript error

Bugs will be moved here once resolved.

Post » Thu Sep 18, 2014 10:11 am

Message: wmsgva is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
Problem Description
After using the Video.SetPlaybackTime method with the video object, the following error occurs:

Javascript error
Uncaught InvalidStateError: Failed to set the "CurrentTime" property on "HTMLMediaElement": The element's
readyState is HAVE_NOTHING, line 686 (col 3)

If this method is not used, the video object works fine and plays the video within my game.

Attach a Capx
Not needed

Description of Capx
N/A

Steps to Reproduce Bug
  • Use the SetPlaybackTime method with the video object

Observed Result
Javascript error displayed (see error in first part of this template). Error doesn't occur if
the video.setplaybacktime method is removed from the code (video plays normally after
using video.play method).

Expected Result
Video should play back faster than normal (video lasts 2 minutes, but set playback time to 15 seconds for testing purposes)

Affected Browsers
  • Chrome: (YES)
  • FireFox: (Not Tested)
  • Internet Explorer: (YES)

Operating System and Service Pack
Windows 7 Professional, latest service pack

Construct 2 Version ID
Construct 2, Release 178 (64 bit)
OpenGL information: Rendering with OpenGL 4.4.0, with NVidia GTX 770 card (using latest NVidia driver, ver 340.52)
B
10
S
3
Posts: 87
Reputation: 957

Post » Thu Sep 18, 2014 10:27 am

Noticed after further researching this error that the problem is that when the js video plugin tries to set the
video's current time, there's no control to ensure the video is ready (hence the HAVE_NOTHING status which is returned).

C:\Program Files\Construct 2\exporters\html5\plugins\video\runtime.js :

Acts.prototype.SetPlaybackTime = function (s)
{
this.video.currentTime = s; >> Need to add some control here to only set this property once video information is known
};
B
10
S
3
Posts: 87
Reputation: 957

Post » Thu Sep 18, 2014 3:09 pm

You can workaround using "IsPlaying" event. Just set it to "Trigger once" then, set playback time.
B
11
S
2
G
1
Posts: 25
Reputation: 1,685

Post » Thu Sep 18, 2014 4:26 pm

Thanks onurdogan07, this works fine.
B
10
S
3
Posts: 87
Reputation: 957

Post » Thu Sep 18, 2014 5:03 pm

welcome
B
11
S
2
G
1
Posts: 25
Reputation: 1,685

Post » Fri Sep 19, 2014 4:58 pm

Closing, a .capx is required or we won't investigate issues. Please submit a new report with a .capx demonstrating the problem as per the guidelines.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,772


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests