We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We are trying to show live video. Through the multiplexer, we transform our stream from mpegts in fmp4. We get errors when trying to play a video:
`
let transmuxer = new muxjs.mp4.Transmuxer(); mediaSource.addEventListener('sourceopen', function(e) { video.muted = true; video.play(); websocket = new WebSocket('ws://127.0.0.1:3333'); websocket.binaryType = 'arraybuffer'; websocket.onopen = function() { let resolution = 240; let bin = JSON.stringify({ resolution }); function strToAb(str) { return new Uint8Array(str.split('') .map(c => c.charCodeAt(0))).buffer; } appendFirstSegment(); websocket.send(strToAb(bin)); } websocket.onmessage = function (e) { websocket.send('PING'); let data = new Uint8Array(e.data); dataBuffer.push(data); transmuxer.push(dataBuffer.shift()); transmuxer.flush(); } function appendFirstSegment(){ URL.revokeObjectURL(video.src); sourceBuffer = mediaSource.addSourceBuffer(mime); sourceBuffer.addEventListener('updateend', function(e) { appendNextSegment() if (video.duration && !video.currentTime) { video.currentTime = video.duration; } }); transmuxer.on('data', (segment) => { let data = new Uint8Array(segment.initSegment.byteLength + segment.data.byteLength); data.set(segment.initSegment, 0); data.set(segment.data, segment.initSegment.byteLength); createInitSegment = false; sourceBuffer.appendBuffer(data); }) } function appendNextSegment(){ transmuxer.off('data'); transmuxer.on('data', (segment) =>{ let data = new Uint8Array(segment.data); sourceBuffer.appendBuffer(data); }) } });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
We are trying to show live video. Through the multiplexer, we transform our stream from mpegts in fmp4. We get errors when trying to play a video:
`
`
The text was updated successfully, but these errors were encountered: