I'm trying to debbug my actionscript (AS3) code on Client side that works with Flash Media Server 4 on localhost. Everything seems fine up to that point.
However, when I'm trying to test my player with other remote streaming servers, I notice bugs because of lower bandwith transmission between the s开发者_如何转开发erver and the player.
Is there a simple way to simulate lower bandwith with FMS4 on localhost ?
- by config, application.xml, etc.?
- by programmation (main.asc) ?
- both ?
If you want to think a little outside of the box, you could use an application such as NetLimiter. Just make a filter for the specific application and you can throttle the bandwidth to whatever speed you'd like (down to bytes).
EDIT
Also, with some brief googling, I was able to find client.setBandwidthLimit and BandwidthCap in the Application.xml file.
There's also an article on Configuring Limiting Bandwidth (if that helps).
In accordance with this article "Configuring Limiting Bandwidth" (see link above - thank Brad Christie) i choose to go with Server-Side ActionScript (SSAS) way. More simple, i think.
Well, here the step what i did :
Make a file "main.asc" et copy & paste the code below.
more info : http://www.peachpit.com/articles/article.aspx?p=31217
main.asc
var bandwidth; application.allowDebug = true; // Application callback functions application.onConnect = function(client, user) { //12800 = 100 Kbps //64000 = 500 Kbps //131072 = 1Mbps //327680 = 2.5 Mbps //983040 = 7.5 Mbps //1966080 = 15 Mbps //3932160 = 30 Mbps //6553600 = 50 Mbps //15728640 = 120 Mbps bandwidth = 64000; client.setBandwidthLimit(bandwidth, bandwidth); trace("clientToServer = " + client.getBandwidthLimit(0) + " serverToClient="+ client.getBandwidthLimit(1)); application.acceptConnection(client); trace("17 janvier TEST"); }
Save the file under the folder underneath FMS's applications directory
Example : FMS\application\dyn
Start the FMS server. If there is a problem, check the log file
Example : FMS\logs_defaultVHost_\dyn_definst_\application.00.log
(optional) Change the value ofthe variable bandwidth for your test. I put in comment some common internet connection speed converted in bytes.
精彩评论