Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Video is slow buffering on first access - how to get around?


Hello!

I am helping a friend with their website. It is a very simple one with mostly html and links. We have a flv video we want to embedded and I loaded up the JWplayer on the server.

The player plays fine except on the first access because the streaming isn't quick enough. I am guessing it is mostly the server which is a cheap one and is known to be slow (GoDaddy - ugh). On second time great because, well obviously, the video is already loaded and in the cache.

I am trying to figure out how to work around this. Here is my player code below. I also found some code on here and I tried to apply it for pre-loading and buffereing but I don't think it is working because even when I clear my cache or go a hard clear (to skip the cache) - it can be fast or slow - it seems random. It might be missing something or in the wrong spot on my page.

Javascript is not my expertise - and although I have done some along with VB and asp.net in the past on a few websites - it has been long time. So I am pretty rusty about where to put code, what order, etc.

bc.. <div id='player'>Loading the player..please stand by!</div>

<script type='text/javascript' src='/jwplayer/jwplayer.js'></script>

<script type='text/javascript'>
jwplayer('player').setup({
'flashplayer': '/jwplayer/player.swf',
'width': '600',
'height': '400',
'file': 'http://www.oursite.com/files/video.flv',
'image': 'http://www.oursite.com/files/videoframe.jpg',
'plugins':
{ 'sharing-3':
{ 'link': 'http://www.oursite.com/index.htm',
'code': '%3Cembed%20src%3D%22http%3A%2F%2Fexample.com%2Fplayers%2F12345.swf%22%20width%3D%22480%22%20height%3D%22270%22%20allowfullscreen%3D%22true%22%20%2F%3E'
}
}
});
</script>




What sort of code can do (simple as possible) that will prevent this first slow load for users once they press the play arrow? Is it the server that is to blame mostly (I am a server newb - only know some basics) or can I do some workaround to get a more smoother first play? If I could successfully reload the video so it is ready in the player that would be great. But there is not much on the page (like I said -real simple) so the page loads rather quickly except the video.

Ps. that is not the real site name it is a fake one.

Thanks!
queen

29 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

Do you have a link that is demonstrating this behavior?

JW Player

User  
0 rated :

Here is my "test" file url with the video:

http://www.veggiepride.com/Chicago/indextest.htm

I know some of code to try the preload is wrong right now but even without that code in it the file - and just the player code above - I still have this problem.

thanks very much, queen

Ethan Feldman

JW Player Support Agent  
0 rated :

Your flv file might lack metadata, use this tool to fix it – http://www.buraks.com/flvmdi/

JW Player

User  
0 rated :

Hi I am having the same problem but I am using an MP4 and the Loading video copy is not appearing. There is a few seconds of a blank screen before the video appears on iphone (connection related). I saved out the MP4 streaming but not loading bars or anything appear the way it does when you view it in a browser. Any help would be greatly appreciated!

here is my code:

<script type="text/javascript" src="jwplayer/jwplayer.js"></script>
<div id="container" style="background-color:#FFF">Loading Video...</div>
<script type="text/javascript">
jwplayer("container").setup({
flashplayer: "jwplayer/player.swf",
file: "video.mp4",
image: "myimage.jpg",
controlbar: 'bottom',
height: 253,
width: 303,
});
</script>

Ethan Feldman

JW Player Support Agent  
0 rated :

Do you have a link?

JW Player

User  
-1 rated :

@Kristin - if you are using GoDaddy as a Server, it has a problem with MP4 files - you need to add the mime extension for video/mp4. I had the same problem. We originally had our video in MP4 but GoDaddy server would not display it on our page. I would get a 404 error and yes, video would not appear. Just thought I would add that info - in case, that is the hosting service you are using too. I converted my video to flv JUST because of this problem.

Thanks so much Ethan - I am trying this right now. Hope I did the conversion right. I used the GUI interface and the exe file under the downloads section on this page. Hopefully this helps - I will get back. :) queen (ps. I like your cute kitty profile pic!)

JW Player

User  
0 rated :

I loaded the new video there but it is still super slow on first load. I have the new video that I ran through the tool on this page.

http://www.veggiepride.com/Chicago/indextestorig.htm

All I have is player code and html stuff on that page.

Anything else I can do?

Ethan Feldman

JW Player Support Agent  
0 rated :

It only takes 3-5 seconds to load for me the first time?

JW Player

User  
0 rated :

Really? Hmm, it actually seems slower to load for me than the original 'unfixed' video was.

My internet is fast but I am wireless. Are you wireless? I am wondering if that is the issue?

Did you clear the cache before you revisited the page?

For 1st time visitors to the page, we are noticing it is loading slow. Because if you visited the page before you might have the download already (but I am sure you know that. :) )

I'll try it on another machine and have some other people test it too.

Ethan Feldman

JW Player Support Agent  
0 rated :

I am using Wireless, basic cable connect, yes, I cleared my cache.

JW Player

User  
0 rated :

Oh meant to add too - that when it starts loading and the video starts playing - the "bar" moves very fast and quickly catches up with what has alredy loaded and than we get the lagging - it does this about 5 or 6 times - although it seems to vary. It does start loading but it doesn't load faster enough before the play bar catches up and it lags because there isn't enough "data" loaded (streamed) yet to play.

Did it run faster for you this time than it did last time with the unfixed video? Did the whole thing load for you in 3-5 seconds or did it just start loading in 3 to 5 seconds?

Ethan Feldman

JW Player Support Agent  
0 rated :

You can fix that by setting the bufferlength variable to something like “10”, for example.

JW Player

User  
0 rated :

Thanks!

I actually did play around with the bufferlength variable but it rally only helped when I set it to 30 and our video is only 37 seconds long. So the video can not be played until it is almost fully loaded. Is there anyway to slow down that bar like the way the YouTube one is?

Ethan Feldman

JW Player Support Agent  
0 rated :

Np. What do you mean by slowing down that bar?

JW Player

User  
0 rated :

Once the video starts playing when enough data in there the bar (the black one that shows the playing progress)moves really fast and catches up to the download process "grey bar". Even though it has only play a few seconds of video. Is that supposed to work like that? I notice on YouTube (I know it is a different player but just comparing) the play bar moves very slowly and seems more "timed" with the downloading bar that shows the data being download. Sorry I am a video noob so I don't know all the names for these features.

I was just running it again and i noticed that even though I had much data of the video streamed it there - it will still often lag and spin at a point that was far from the the end of the "gray bar".

Ethan Feldman

JW Player Support Agent  
0 rated :

How big (mb) is your FLV file ?

JW Player

User  
0 rated :

10.5 MB - too big??

Ethan Feldman

JW Player Support Agent  
0 rated :

How long is the file?

JW Player

User  
0 rated :

37 seconds

Ethan Feldman

JW Player Support Agent  
0 rated :

10.5 MB is way, way too big for a 37 second file. It should be close to Our sample video which is only 7 seconds long is only 212 KB, and that is also a FLV.

JW Player

User  
0 rated :

If I compress it, will I lose quality?

Is the size of it causeing it to be so slow?

Ethan Feldman

JW Player Support Agent  
0 rated :

The size is the reason it is loading so slowly, and yes if you compress it, the quality will go down, but its too high right now, it needs to be smaller.

JW Player

User  
0 rated :

Thanks!

Any suggestions of a good free compression application that I can try? how many KB/MB should it be really? I am guessing around 1MB for the 37 seconds.

I would like to try to compress it and see how it goes - right now, we just having the bufferlength at 20 and people have to wait a bit for first download before it plays but it would be nice to not have to do that. It takes like over a 1 mintue for it to preload - and I thought that seemed awfully long for a video that is only 37 seconds.

Ethan Feldman

JW Player Support Agent  
0 rated :

I always use – http://handbrake.fr/

JW Player

User  
0 rated :

I download HandBrake but I know nothing about videos/compression (I didn't make this video) - do you have any tips for me on what would be the best way to compress this video in HandBrake? What options to pick?

Ethan Feldman

JW Player Support Agent  
0 rated :

When encoding, make sure to check off web optimized, use AAC for Audio H.264 (x264) for the video.

JW Player

User  
0 rated :

videos buffering too much.i can't even see any further full videos b'coz of buffering with 5 or 10 sec.n do need ful to me

JW Player

User  
0 rated :

while Seeing videos the internet cannot display this web page is available,what's wrong with my Internet.

Ethan Feldman

JW Player Support Agent  
0 rated :

Provide a link please.

This question has received the maximum number of answers.