2010 posts
  • Has referred 50+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+9 more
bitfade says

i’ve spent almost 10 fxxxing days on this…
now it seems i finally found a (ugly) solution but still wonder if this can be addressed in other ways.

the problem arise when seeking ahead of loaded video:

  1. a "NetStream.Play.Stop" event gets fired randomly
  2. video freeze and resume only when buffer (2s) gets filled again
2 is most annoying since it stops playback for undefined number of seconds

using (bytesLoaded/bytesTotal)*duration as upper seek limit does not solve
since for variable bitrate media it’s just an approximation.

lots of videoplayer authors here, any advice on fighting this ?

8291 posts Community Moderator
  • Has referred 10+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Attended one of our Meetups around the world
+9 more
MSFX Moderator says
the problem arise when seeking ahead of loaded video

this depends on what you mean by this…

Are you using progressive http download / streaming or youtube style streaming with php / asp?

2010 posts
  • Has referred 50+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+9 more
bitfade says

progressive http

8291 posts Community Moderator
  • Has referred 10+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Attended one of our Meetups around the world
+9 more
MSFX Moderator says
progressive http

easiest way around is to prevent them seeking past the currently loaded point…

http://s3.envato.com/files/91461/flvPlayer3.html

This a version of my player and if you try to scrub past the currently loaded point it wont allow you to which saves having to deal with all the issues that netstream brings when trying to seek to an unbuffered point…

2010 posts
  • Has referred 50+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+9 more
bitfade says
easiest way around is to prevent them seeking past the currently loaded point…
how do you get currently loaded point ?
8291 posts Community Moderator
  • Has referred 10+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Attended one of our Meetups around the world
+9 more
MSFX Moderator says
easiest way around is to prevent them seeking past the currently loaded point…
how do you get currently loaded point ?

I store it as a % within my VideoCore class thats calculated when needed…

public function get percentLoaded():Number
{
    return Number((videoStream.bytesLoaded / videoStream.bytesTotal).toFixed(2));
}

Then my MediaScrubber class calls this once a second to update its length of whats loaded.

The Mouse Listener for MediaScrubber is only on the loaded bar but returns a % of where on the full bars width your clicking which is the % of the video that you then seek to using something like…

public function seek($seekTo:Number):void 
{
    videoStream.seek(duration * $seekTo);
    _playing = true;
} 

Because the Mouse Listener is only on the loaded bar you can never seek past whats loaded…

hope that makes some kind of sense :)

2010 posts
  • Has referred 50+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+9 more
bitfade says

using bytesLoded/bytesTotal won’t work ‘cause
highly variable bitrate videos will always fool an upper seek bound based on that.

Even setting limit to 5s less than (bytesLoded/bytesTotal)*duration it’s not enough to prevent the issue with some videos

ps
your preview does not work for me (firefox 3.5/linux)
it locks at “initalizing”

8291 posts Community Moderator
  • Has referred 10+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Attended one of our Meetups around the world
+9 more
MSFX Moderator says
using bytesLoded/bytesTotal won’t work ‘cause
highly variable bitrate videos will always fool an upper seek bound based on that.

I guess thats an issue that you can’t really get round :( i’ve never had an issue with it though…

ps
your preview does not work for me (firefox 3.5/linux)
it locks at "initalizing"

hmmm, works fine here XP / FF 3 .5.

If you have Firebug would you mind seeing whats causing it to hang up?

2010 posts
  • Has referred 50+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+9 more
bitfade says
i’ve translated it from italian, so exact english message could be different
Permission denied to <hxxp://s3.envato.com> 
for calling Location.toString method on <hxxp://activeden.net>

about the issue, just try the player with some high bitrate videos on a (simulated) slow link

1312 posts
  • Has referred 200+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+8 more
LGLab says

Funny I was actually making a flv player in AS3 and was about to try and deal with this.

Would it not be good practice to set the rectangle boundaries used for the scrub startDrag, to a rectangle that is changed dynamically in the video load function as in:

public function setloadProgress(event:Event):void
{        
var loadedPercent:Number = stream.bytesLoaded*100/stream.bytesTotal;
videoControls.loadBar.loadProgressBar.width = loadedPercent*loadBarWidth/100;
vidRect=new Rectangle(0,3,videoControls.loadBar.loadProgressBar.width,0); 
}

Then in the scrub function:

private function scrubButtonPressed(event:MouseEvent):void
{
videoControls.loadBar.loadBarScrub.startDrag(false,vidRect);
}

AS3 noob here…be nice :D

by
by
by
by
by
by