Search code examples
flashactionscript-3videostreamnetstream

NetStream only playing when fully loaded


I've been searching for this for a while, and either my google-fu is weak or there is no easy to find answer yet...

I am using a NetStream to stream a video file from anywhere. The NetStream is NOT connected to any server. Here is the code:

            // Create new connection and stream
            _netCon = new NetConnection();
            _netCon.connect(null);

            _netStream = new NetStream(_netCon);
            _netStream.client = this;
            _netStream.play(url);

            // Configure video layer
            _videoLayer.attachNetStream(null);
            _videoLayer.attachNetStream(_netStream);
            _videoLayer.width = stage.stageWidth;
            _videoLayer.height = stage.stageHeight;

This basically works, of course, but the video always starts playing only when it is fully loaded. It also passes the metadata only then. But the main reason to use a NetStream is so that you can play a video BEFORE it is fully loaded.

I tried playing around with the bufferTime property, but to no avail. Also made sure that there is no caching involved when loading the video. I always load a "new one" by adding some "?bla=date" value behind the url.

Is it possible that the "real" streaming only works when really connected to a server? Or am I missing something else?


Solution

  • To clear things up:

    The problem was indeed within the position of the metadata within our video files. We did not resolve that for the time being as we had more important issues. But we will come back to that, moving the metadata position to the beginning of the video files.

    Thanks for the help!