I'm using ffmpeg.wasm in my site but it only works if the browser supports SharedArrayBuffer. Is there a simple way to test using javascript (browser js or nodejs) if the browser has support to it? One solution I thought was to compare the user agent with the list offered in this website but this would be too verbose and I'm guessing if there isn't a simpler way?
How to detect if a browser supports SharedArrayBuffer?
Asked Answered
You can do all that but the easiest way of finding out is just checking here, but if you want to do it runtime you can add this line of code in your browser
try{
var sab = new SharedArrayBuffer(1024);
if(sab===undefined)throw new Error('not supported')
}
catch(e){
alert('browser doesnot support SharedArrayBuffer: ",e)
}
© 2022 - 2024 — McMap. All rights reserved.
if( typeof SharedArrayBuffer !== 'undefined' ) {
– Daemon