Skip to main content
April 22, 2008
Answered

Video Player Error when "scrubbing" ahead of available content

  • April 22, 2008
  • 2 replies
  • 595 views
Hi there, hopefully someone can help me work out this problem I've been having for the past two days!!

I have a built my own AS3 Flash video player and the 'scrubber' bar appears to be causing an error message when dragged too far ahead (I assume because it's dragging ahead to a part of the video which has yet to fully load). This problem doesn't happen when debugging the movie in Flash but does appear when loaded into a HTML page.

The error message I'm getting is....

quote:


Error #2044: Unhandled NetStatusEvent:. level=error, code=NetStream.Seek.InvalidTime
at VPlayer()



My VPlayer Class (which creates the video player) code is as follows....

NOTE: to find the scrubbing code look for the comment "// Handle the scrubbing through the video playback" and you'll see that I've attempted to wrap the scrubbing code in a Try/Catch statement (which doesn't seem to work as it doesn't catch any errors so you can remove that Try/Catch statement if you feel it's not needed)

Any help is greatly appreciated as I'm banging my head on the desk trying to work out how to fix it. I'm relatively new to AS3 so this may (hopefully) be an easy fix

Kind regards,
M.
This topic has been closed for replies.
Correct answer
Thank you!! :)

Your reply helped solve the problem.

I was adding the event listener to the wrong element. I was originally adding it to the NetConnection....

e.g.
connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

....but I was supposed to be adding it to the NetStream....

i.e.
_stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

Thank you!

Kind regards,
M.

2 replies

Participating Frequently
July 16, 2008
See this cool mp3 xml player with visualization, playlist and skins. Fully customisable. Vector. http://flashden.net/item/mp3-xml-strongplayerstrong-with-visualization-and-skins-vectorised/11851
Inspiring
April 22, 2008
NetStream also fires the NetStatusEvent, so adding a handler should suppress
that error message:

_stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);



Correct answer
April 23, 2008
Thank you!! :)

Your reply helped solve the problem.

I was adding the event listener to the wrong element. I was originally adding it to the NetConnection....

e.g.
connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

....but I was supposed to be adding it to the NetStream....

i.e.
_stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

Thank you!

Kind regards,
M.