Hi. Great idea to add this feature. May I suggest another optimization for the Online Vids plugin? For me case is as follows:
Videos are buffered to compensate for NW issues to guarantee smooth playback. Thats why we buffer a part of the stream before we start playing, right?
So maybe we can make this calculation a little smarter. Can you read out the MB/sec that a stream has (on VBR use an average value)? If so we sould say buffer the minimum of 2% or x seconds of video (x can be configured, should default to something like 2-3 seconds).
Or even better, add another option for maximum bandwith, resulting in the following calculation:
br = Bitrate of the video
size = total size of video
size/br = duration of video
x = config option, how many seconds of video should be buffered
y = config option, what is the download speed of your internet connection
if br>y then
buffer = size - ((size/br + x)*y); // We need to download most of the video because bit rate is higher than our download speed.
// Assume that we can start playing as soon as the leftover time is enough to download the rest and add the buffer seconds to that
else
buffer = min(size/50,br*x); // Buffer 2% or configured number of seconds, whichever is the lowest
Videos are buffered to compensate for NW issues to guarantee smooth playback. Thats why we buffer a part of the stream before we start playing, right?
So maybe we can make this calculation a little smarter. Can you read out the MB/sec that a stream has (on VBR use an average value)? If so we sould say buffer the minimum of 2% or x seconds of video (x can be configured, should default to something like 2-3 seconds).
Or even better, add another option for maximum bandwith, resulting in the following calculation:
br = Bitrate of the video
size = total size of video
size/br = duration of video
x = config option, how many seconds of video should be buffered
y = config option, what is the download speed of your internet connection
if br>y then
buffer = size - ((size/br + x)*y); // We need to download most of the video because bit rate is higher than our download speed.
// Assume that we can start playing as soon as the leftover time is enough to download the rest and add the buffer seconds to that
else
buffer = min(size/50,br*x); // Buffer 2% or configured number of seconds, whichever is the lowest