hasBeenAborted()
将错误传递给 hasBeenAborted() 函数,以检查错误是否是因为你选择中止渲染而抛出的。 在这种情况下,错误是故意的,你可能不想显示它。
🌐 Pass an error to the hasBeenAborted() function to check if the error was thrown because you opted to abort the render.
In this case, the error is intentional and you probably don't want to display it.
检查媒体文件下载是否已被中止。
🌐 Check if a media file download has been aborted.
Check if a download has been abortedimport {parseMedia ,hasBeenAborted } from '@remotion/media-parser'; try { awaitparseMedia ({src : 'https://www.w3schools.com/html/mov_bbb.mp4', }); } catch (e ) { if (hasBeenAborted (e )) {console .log ('Has been aborted by user / developer'); } else {console .error ('Download failed',e ); } }
另请参阅
🌐 See also