Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

choppy video playback (NetStream)

Engaged ,
Nov 06, 2008 Nov 06, 2008
Hi All,

Does anyone know what is best practice for buffering video playback? To prevent choppy playback?

Using NetStream etc...

Any help appreciated.

Kind Regards,

Boxing Boom
TOPICS
ActionScript
1.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 06, 2008 Nov 06, 2008
detect the user's download speed, your videos bitrate and don't start your video playing until you're confident the user's download speed will keep up the the remaining video that's to be loaded.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 06, 2008 Nov 06, 2008
Hi Kglad,

Thanks for your reply; a sample of code would be a real bonus ;)

Kind Regards,

Boxing Boom
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 06, 2008 Nov 06, 2008
you're welcome.

i don't know the code off the top of my head or i would give it to you. but using the onmetadata event's databitrate, you can determine the videos bitrate. using the netstream's bytesloaded property you can determine the user's download speed. and with those two pieces of info you can determine if the video can stream without stuttering or if you need to buffer some video. and if you need to buffer some video, how much to buffer.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 07, 2008 Nov 07, 2008
Hi,

Wouldn't it be an easier route; if we could just buffer the stream untill it's ready to play all of the video? And have a spinning mc displayed untill it was ready to play in full?

I'd like to know your thoughts Kglad, on how good a technique this may be, and possibly how to code this up ;)

stream.pause();
stream.bufferTime = stream.bufferLength;
stream.resume();

Or maybe this? As follows?

function statusHandler(event:NetStatusEvent):void
{
switch (event.info.code)
{
case "NetStream.Buffer.Empty":
spinning_mc.visible = true;
stream.pause();
break;
case "NetStream.Buffer.Full":
spinning_mc.visible = false;
stream.resume();
break;
}
}


Is it along the lines of code provided?


Kind Regards,

Boxing Boom
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 07, 2008 Nov 07, 2008
that's not what i was thinking but if it works, great. does it work?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 07, 2008 Nov 07, 2008
I use this which gets kilobits per second after the file referenced in the parameter is loaded.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 08, 2008 Nov 08, 2008
Hi All,

Sorry for the delayed response ;)

Kglad, no I have not tested at present, but will be working on this next week (Monday) and will post my efforts 😉 I will, however try to code what you mentioned about detecting the user's download speed etc...

Rob, thanks for sharing your code; I will certainly look into it, and see if it helps my situation.

Have a great weekend.

Kind Regards,

Boxing Boom
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 08, 2008 Nov 08, 2008
LATEST
If you are streaming from FMS there is bandwidth detection routine on the server that you can call from you code - no work around needed.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines