I solved this. This is actually part of the final solution. The problem is,
the code returns an empty value for onBWCheck and onBWcomplete never fires.
I finally discovered the key piece of code after a lot of trial and error.
There is a boolean being passed to the server in the following code:

//We have the stream, app and server, call the connect function
VSConnect(serverName, appName, true, streamName);

That third argument is a switch that tells the server to check the users
bandwidth or not. In the example provided by VitalStream it was set to false
so the bandwidth check was never performed by the server. Once I switched it
to true the variable p_bw does contain the users bandwidth and it was a
breeze from there. Just an if statement comparing p_bw to the bitrate of the
encoded .flv files. Now everything is working great. 

It's funny I had a support ticket open with VitalStream for about one month
going back and forth on this issue. They insisted that their was no
bandwidth detection in their code and I would have to write the code myself
but I could see parts of the bandwidth detection code in their source. It
was as simple as switching a variable from false to true to make it work. I
hope this helps someone else with the same issue.

Brian

> looks like bwcheck to me. i'd just use p_bw in a condition where p_bw is
detected bandwidth.

> if p_bw is less than than x play stream1, else if p_bw is greater than x
and less than y play stream2, else play stream3. 
ie. stream1=56kbps; stream2=150kbps; stream3=300kbps;

> i usually run the bwcheck on an interval several times and get an average
bw figure to go by and even dynamically change streams-- you can do it
seemlessly by bookmarking ns.time and seeking to it once new stream has
loaded.


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to