Local file .H264 file is not playing for the full time
ruthsam244 opened this issue · 4 comments
I am uploading the h264 file from my local computer. The video plays well but does not play for the full time. Like i had 59.55mins data but the files play for like 30 sec or 2mins 30sec. Iam using the source code of the live demo of the repository. Can you please help me with this?
This is my script file :-
<script>
window.onload = function () {
debugger
document.getElementById('play-btn').addEventListener('click', function (e) {
if (jmuxer) {
jmuxer.destroy();
}
var file = document.getElementById('h264_file');
if (!file.files.length) {
alert('Please choose a file.');
return;
}
var fps = parseInt(document.getElementById('fps-input').value) || 1;
reader.readAsArrayBuffer(file.files[0]);
jmuxer = new JMuxer({
node: 'player',
mode: 'video',
flushingTime: 0,
fps: fps,
clearBuffer: true,
debug: true,
readFpsFromTrack : true
});
}, false);
var jmuxer, duration = 3600000;
var reader = new FileReader();
reader.onload = function (e) {
console.log('File read successfully:', new Uint8Array(e.target.result));
jmuxer.feed({
video: new Uint8Array(e.target.result),
duration : duration
});
console.log(jmuxer)
};
}
</script>
<script type="text/javascript" src="./dist/jmuxer.js"></script>
@samirkumardas Kindly help me with this!
When you play the file in this player https://samirkumardas.github.io/jmuxer/h264_player.html do you get the same result?
@samirkumardas, Yes Absolutely! The functionality also works the same way, but the only thing is Iam getting lesser chunks of data say 9000000, then the chunks of the data if i upload demo.h264.
@samirkumardas any thoughts on this? How to resolve it?