I am referring a media source api demo given on this link
It is working fine for the given test webm file but when i tried to change the name of the file to a custom webm file the code stopped working.
It is generating following error : Uncaught Error: INVALID_STATE_ERR: DOM Exception 11
at following code : sourceBuffer.append(new Uint8Array(e.target.result));
To check whether the custom webm file is working i have created a test page in which i have defined a video tag having source of that custom webm file. When i ran the code it is working fine.
I am unable to understand the reason for this strange behavior.
The most likely problem is your WebM file has Clusters that don't start with a keyframe.
In Chrome dev-channel builds (ie Chrome 25 or later), you can verify this with the following steps.
If you see a message that says something like "Media segment did not begin with keyframe." then it means your file has Clusters that don't start with a keyframe. This is common with content that is generated by FFmpeg. You can fix your file in one of the following ways:
UPDATE: no internal error shown in my case (accepted answer suggests to check) but still the same problem
I ran into the same trouble when trying to play recorded .webm file by MediaRecorder API back using Media Source Extensions (MSE). Chrome (51) recordings are malformed, Firefox (46) seems OK.
To get it working you have to fix cues in .webm file:
cmake .
make
./sample_muxer -i original.webm -o fixed.webm
Hope it helped someone. It was quite difficult to google any information without the DASH keyword (i am not using DASH, only the same underlying technology - MSE) :)