javascript – Sourcebuffer.appendBuffer throws InvalidState exception on iOS


I am trying to visualize in an HTML5 video element a stream of frames I receive from a server. I have implemented it using a sourceBuffer according to this

The streaming works perfectly on Desktop (Edge, Chrome, Firefox) and on Android but on iOS the system throws an “InvalidState exception – Object is not in a valid state” each time I try to append a new frame to the buffer.

I have read around this can be a mimetype codec problem but even trying many of them it still does not work

I have tried using different codecs according to this

mimeCodec="video/mp4; codecs="avc1.64001F"

I have also checked the system support the used codec by adding this checkbut it alsways return true:

if (!("MediaSource' in window && MediaSource.isTypeSupported(mimeCodec))) {
   reject('Unsupported MIME type or codec: ' + mimeCodec);
}

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img