You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the "buffer when needed" version, Chrome will only load size/totalSegments on the first request. That's nice, but now it will not show the length of the video nor can I seek forward/backward into the video.
Any help?
Regards, Chris
The text was updated successfully, but these errors were encountered:
Unfortunately the demo is incomplete on this part and you need to provide your own duration.
At this point the demo only knows that the video size is undetermined. You need update the getFileLength code, to also fetch the file duration from the server and use that result instead of "video.duration".
Replace the function with this updated version:
function getFileLength(url, cb) {
var xhr = new XMLHttpRequest;
xhr.open('head', url);
xhr.onload = function () {
cb(xhr.getResponseHeader('content-length'), xhr.getResponseHeader('content-duration'));
};
xhr.send();
};
Change the getFileLength call to this getFileLength(assetURL, function (fileLength, fileDuration) {
And update segmentDuration = video.duration / totalSegments;
Very nice code, thank you!
When using the "buffer when needed" version, Chrome will only load size/totalSegments on the first request. That's nice, but now it will not show the length of the video nor can I seek forward/backward into the video.
Any help?
Regards, Chris
The text was updated successfully, but these errors were encountered: