浏览代码

Editor: Revoke old video ObjectURLs

Mr.doob 4 年之前
父节点
当前提交
9ea6a221c4
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      editor/js/Sidebar.Project.Video.js

+ 6 - 2
editor/js/Sidebar.Project.Video.js

@@ -124,12 +124,16 @@ function SidebarProjectVideo( editor ) {
 
 
 	function save( blob, filename ) {
 	function save( blob, filename ) {
 
 
+		if ( link.href ) {
+
+			URL.revokeObjectURL( link.href );
+
+		}
+
 		link.href = URL.createObjectURL( blob );
 		link.href = URL.createObjectURL( blob );
 		link.download = filename;
 		link.download = filename;
 		link.dispatchEvent( new MouseEvent( 'click' ) );
 		link.dispatchEvent( new MouseEvent( 'click' ) );
 
 
-		// URL.revokeObjectURL( url ); breaks Firefox...
-
 	}
 	}
 
 
 	//
 	//