Jump to content

Loading Flash video


justsomeguy
 Share

Recommended Posts

I'm having a problem loading an external FLV file to play in a SWF file. I am using this code, straight from the Flash docs:

	// Create a NetConnection object	var my_nc:NetConnection = new NetConnection();	// Create a local streaming connection	my_nc.connect(null);	// Create a NetStream object and define an onStatus() function	var my_ns:NetStream = new NetStream(my_nc);	my_ns.onStatus = function(infoObject:Object):Void {		_root.infotext += "status (" + this.time + " seconds)\n";		_root.infotext += "\t Level: " + infoObject.level + "\n";		_root.infotext += "\t Code: " + infoObject.code + "\n\n";	};	// Attach the NetStream video feed to the Video object	vid.attachVideo(my_ns);	// Set the buffer time	my_ns.setBufferTime(5);	// Begin playing the FLV file	my_ns.play("http://path/to.flv");

The FLV file is located on an external server. This will work fine when I test the movie or when I double-click on the SWF file locally, it loads the FLV and starts to play it. When I upload the SWF to the same server as the FLV file and load the SWF then it won't display the video, it doesn't show anything. I've tried publishing the SWF with permissions to access local files or network files and both cases show the same behavior both locally and on the server.What am I missing?

Link to comment
Share on other sites

That doesn't affect playback. The first time I tried the player with local only access it did show a black square where the video should be and the Netstream.Play.Start event was called, although the video never actually started playing. If I refresh the page it won't even do that, it still just sits there. If I play it locally on my computer (even with the FLV still being on the server) I get these messages from the code:

status (0 seconds)	 Level: status	 Code: NetStream.Play.Startstatus (0.574 seconds)	 Level: status	 Code: NetStream.Buffer.Full

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...