views:

42

answers:

3

We have a custom flash video player. It uses streaming over a hosted FMS $50/month account.

Some users are complaining that the video doesn't play at all.

With one of these users, we had them go to a speed test website and it was determined that they had a very slow connection which we are assuming is what is causing them to not be able to view the video.

So before we try to load the video we want to determine their connection speed. Then if they have a good enough connection we will play the video and if not then we will do something else like play a lower quality video or simply display a message and not play a video at all.

So, what is the best way to determine the users connection speed in this situation? Should we use actionscript? should we do a streaming test or a progressive test? should we use ajax and send the result into flash?

A: 

http://www.bigresource.com/FLASH-Detect-user-connection-speed-grCV5amDJg.html

Maged
Ryan
thanks , i just try to help
Maged
A: 

You can use a SMIL file to define different versions of the video, with different bit rates, and the bandwidth detection should then be taken care of for you, by the FMS server and the FLVPlayback component, I believe:

http://help.adobe.com/en_US/as3/components/WS5b3ccc516d4fbf351e63e3d118a9c65b32-7f13.html

Lars
i don't think that will work because I'm not using the FLVPlayback component and the played back media is more complex then a single flv. so what i'm really looking for is a way to calculate the bandwidth independently...like those bandwidth spped test sites. then once i get that number at the start of my app i can do whatever i want with my custom player.
Ryan
A: 

If you have a hosted FMS account, they often offer pre-built video players with dynamic streaming built in.

If you are using OSMF (the Open Source Media Framework), you can use the Strobe Media Player which offers dynamic streaming, you just have to create a file with all the streams: http://forums.adobe.com/thread/679664?tstart=0

Or if you are building your own OSMF player, you can just write some code:

    var RTMP_URL = "your-rtmp-link";
    var resource:DynamicStreamingResource = new DynamicStreamingResource(RTMP_URL);

    var vector:Vector.<DynamicStreamingItem >  = new Vector.<DynamicStreamingItem > (2);
    vector[0] = new DynamicStreamingItem("mp4:my-high-link.f4v",1500);
    vector[1] = new DynamicStreamingItem("mp4:my-low-link.f4v",400);**
    resource.streamItems = vector;

    videoElement = new VideoElement(resource);
    player = new MediaPlayer;
    player.autoPlay = true;

    container = new MediaContainer;
    addChild(container);

    player.media = videoElement;
    container.addMediaElement(videoElement);

    player.play();

Or, if you wrote your player with regular actionscript (no framework) Influxis has a tutorial: http://labs.influxis.com/?p=91

redconservatory