In our local application we noticed that if you run the ffmpeg-wasm convert engine multiple times in a row, even after calling the VideoJS dispose function, the plugin loads the ffmpeg workers into the browser on every conversion. This caused a memory leak and eventual crash in our application, as the number of workers trying to run kept growing and growing
I've added a dispose hook in the convert engine similar to the record engine, which would be called when the player is disposed of, and cleans up the ffmpeg workers to avoid the memory leak.
coverage: 71.353% (-0.09%) from 71.445%
when pulling b5d97e464d343adb7434d0f89c7b7d325bf7ea49 on kira:fix-ffmpeg-wasm-leak
into 1285cec84cb3e8b7d8f71e51087acfc08d356fc2 on collab-project:master.
In our local application we noticed that if you run the ffmpeg-wasm convert engine multiple times in a row, even after calling the VideoJS
dispose
function, the plugin loads the ffmpeg workers into the browser on every conversion. This caused a memory leak and eventual crash in our application, as the number of workers trying to run kept growing and growingI've added a dispose hook in the convert engine similar to the record engine, which would be called when the player is disposed of, and cleans up the ffmpeg workers to avoid the memory leak.