0

I am using osmf player to play HDS format videos. At a certain scenario I am stopping the video and removing it from stage. For some reason it throws the following error:

Error: Error #2154: The NetStream Object is invalid.  This may be due to a failed NetConnection.
at flash.net::NetStream/play2()
at org.osmf.net.rtmpstreaming::RTMPDynamicStreamingNetLoader/reconnectStream()

My attempts to fix it were not successful so I am looking for a way to catch this specific error somehow. I am looking for ideas on how to handle this error in my code(can't use global error handling). Any directions on how to fix this bug would be also awesome! Thanks!

Eran
  • 1,628
  • 16
  • 31
  • Can you show the part of your code where you "stop and remove" the video ? From the look of it, OSMF does not consider itself as stopped, and try to continue to play the stream. – Aralicia May 07 '14 at 12:23
  • To be more precise the code that triggers the error is when the main player removes the osmf player using Loader.unloadAndStop http://helpx.adobe.com/flash/kb/flash-player-10-action-script.html . – Eran May 08 '14 at 18:00
  • Okay, I understand better. You really should stop OSMF before unloading the swf that contains it (by using [MediaPlayer.stop](http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/org/osmf/media/MediaPlayer.html#stop%28%29). unloadAndStop() only stop frame-related processes; and OSMF do many things that aren't frame-related (like downloading video data). – Aralicia May 09 '14 at 07:52

0 Answers0