all groups > flash actionscript > november 2004 >
You're in the

flash actionscript

group:

<strong>Please someone answer....Can I use mediaPlayback component and set the buffer time?</strong>


<strong>Please someone answer....Can I use mediaPlayback component and set the buffer time?</strong> raznov
11/14/2004 6:29:04 PM
flash actionscript:
I am using the mediaPlayback component to play external .flv files. First
problem I had was that they were stopping intermittently when loaded to the
server.. so I read up on the netStream class and attached this basic code...
var netConn:NetConnection = new NetConnection(); netConn.connect(null); var
netStream:NetStream = new NetStream(netConn); //my_video is the name of the
component instance on the stage my_video.attachVideo(netStream);
netStream.setBufferTime(20); netStream.play('introDemo.flv'); Now.. the audio
plays but no video plays and the controls on the component do not work now...
ie.. can't pause it. or adjust the volume.:confused;
Re: <strong>Please someone answer....Can I use mediaPlayback component and set the buffer time?</strong> Rothrock
11/14/2004 11:15:06 PM
If you are using the playback component I don't think the netStream stuff will
help you. That is for building your own. Is your question how to 'buffer' the
stream? If so here is what I am doing. I'm using separate MediaDisplay and
MediaController I have the controller come in paused and with the controls
hidden. Then I use a setInterval to check every 250 milliseconds or so. I check
what percentage of the file has downloaded. In my case, when it gets to 25
percent I tell the controller to show the controls, but you could do a lot of
other things. You could tell it to start playing. Or you could estimate the
remaining time to download and if it less than the time of the entire video you
could then tell it to play. Look in the help files under Component
Dictionary->Using Components->Media Components.
Re: <strong>Please someone answer....Can I use mediaPlayback component and set the buffer time?</strong> raznov
11/15/2004 2:00:29 PM
Thanks. so much for your reply. That was what I was confused about.. What you
are saying is that if you use the MediaPlayback component it does not
automatically buffer the video? I have uploaded the files to my server and it
seems that late at night it works perfectly but rigth now.. it run out of sync
and slow.. is that the lack of buffer settings or the server itself?
Re: <strong>Please someone answer....Can I use mediaPlayback component and set the buffer time?</strong> Rothrock
11/15/2004 3:35:24 PM
As far as I know there isn't any autobuffering built into the components. But
you can design your own. I like the approach I'm taking.
http://www.saffronthread.com/test4/SariFactory.html to what I'm doing. (BTW if
you do check it out could you let me know the times, quality, and what system
you are using? Thanks.)
Re: <strong>Please someone answer....Can I use mediaPlayback component and set the buffer time?</strong> raznov
11/15/2004 3:45:53 PM
I checked out your video.. it look great in tems of quality.. and it took 54
second to download.. i am running windows xp and am on DSL. I am confused
though.. it this an external .flv file or embedded becasue you are loading the
entire video before it can play. I wanted to use the streaming option and have
linked my .fvl files to the .swf media component.
Re: <strong>Please someone answer....Can I use mediaPlayback component and set the buffer time?</strong> Rothrock
11/15/2004 3:57:29 PM
This is a dynamically loaded flv. Did the playback controls appear before it
had finished loading? If so, you could have clicked play at anytime. (Or I
could program it to start playing back.) What I currently have is that after
25% of the file is loaded it starts checking to see if the estimated download
time is less than the total playing time. (In other words, even if we start
playing right now will it finish loading before the playhead catches up?) If
the answer is yes it shows the playback controls. If the answer is no, it keeps
checking until the answer is yes. So with 54 seconds total download time the
controls should have appeared after about 15 seconds? (BTW what was the
estimated time?)
Re: <strong>Please someone answer....Can I use mediaPlayback component and set the buffer time?</strong> raznov
11/15/2004 4:02:03 PM
Re: <strong>Please someone answer....Can I use mediaPlayback component and set the buffer time?</strong> Rothrock
11/15/2004 4:27:53 PM
Re: <strong>Please someone answer....Can I use mediaPlayback component and set the buffer time?</strong> raznov
11/15/2004 4:32:30 PM
Re: <strong>Please someone answer....Can I use mediaPlayback component and set the buffer time?</strong> Rothrock
11/15/2004 4:46:31 PM
Well at the same time as I tell the controller to show the controls, I could
also tell it to start playing. That would then stream, right? Also if the
playhead catches up with the download, I think it sends an event which could be
listened for and put it back into 'buffering' mode. But then again, there could
be built in buffering and I just don't know it. Check out the help files under
Component Dictionary and Using Components.
Re: <strong>Please someone answer....Can I use mediaPlayback component and set the buffer time?</strong> raznov
11/15/2004 4:58:45 PM
That is true... Maybe I am just looking for an easy answer because I thought
this would be easy to begin with :) I have read everything I can find at
this point. I think what I am really confused about is what the the
mediaComponent is actually doing.. because I have no preloader on my ,swf and
I am loading a 17 meg .fv file externally into it... when I test it on the
server.. it starts playing automatically, but it is not in sync right now.. but
when I test edlast night it was perfect..
http://www.editundo.to/va/HIG_SB_SBA_intro.html
Re: <strong>Please someone answer....Can I use mediaPlayback component and set the buffer time?</strong> Rothrock
11/15/2004 5:46:33 PM
Hmm, yeah something seems to be a bit off there. (Nice video and editing and
all.) How are you creating the FLV? I don't use the MediaPlayback component I
think there used to be (still are?) problems with it. Instead I use separate
MediaDisplay and MediaController components. If you look at the component
inspector of the controller you find something that says to load the controller
in the paused position. (I can't remember exactly what it is called and don't
have MX04 here at work.) I've heard things about the audio and video getting
out of sync here on the boards. I haven't experienced them, so I haven't paid
much attention. How are you making the FLV? What is its framerate? What is the
framerate of the loading swf? What quality/settings are you using for the sound
channel? As you could probably tell from my sample, I am testing out Sorensen
Squeeze and think I will probably purchase it. My video is about the same
length as yours, is playing at about the same size, but is only 7.8 megs. (I
know the quality of mine isn't quite as sharp as yours, but I think I could
match the quality and still be smaller than 17 megs.)
AddThis Social Bookmark Button