Skip to content

Commit

Permalink
RecordApp添加UseLazyLoad选项,对部分非核心组件进行延迟加载
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangyuecn committed Jan 27, 2020
1 parent fc3bb36 commit 5d9dee8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app-support-sample/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
});

//可以设置组件是否进行延迟加载,默认会延迟加载,不会阻塞Install
RecordApp.UseLazyLoad=!!(+localStorage["RecordApp_UseLazyLoad"]||0);
RecordApp.UseLazyLoad=!(+localStorage["RecordApp_UseLazyLoadDisable"]||0);

//立即加载环境,自动把Recorder加载进来
RecordApp.Install(function(){
Expand Down Expand Up @@ -854,7 +854,7 @@

reclog("提示:部分组件可能会设置在Install成功后进行延迟加载,Start、Stop操作在组件未加载完时会等待OnLazyReady事件触发,可通过设置RecordApp.UseLazyLoad=false关闭此特性(会阻塞Install导致RequestPermission变慢),<span style='color:"+(RecordApp.UseLazyLoad?"#0b1'>当前已启用":"red'>当前已关闭")+"此特性</span><button onclick='changeUseLazyLoad()'>"+(RecordApp.UseLazyLoad?"关闭":"启用")+"</button>");
window.changeUseLazyLoad=function(){
localStorage["RecordApp_UseLazyLoad"]=RecordApp.UseLazyLoad?0:1;
localStorage["RecordApp_UseLazyLoadDisable"]=RecordApp.UseLazyLoad?1:0;
location.reload();
};
RecordApp.Current.OnLazyReady(function(){
Expand Down
8 changes: 4 additions & 4 deletions assets/npm-home/hash-history.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
[
{
"sha1": "37aa5f16f3ff3bba8a6f7e7ee1db018007e13639",
"time": "2020-1-28 04:41:38"
},
{
"sha1": "96ba713840ef578e59374ee2b012460fd4889bbc",
"time": "2020-1-28 04:28:51"
Expand All @@ -14,9 +18,5 @@
{
"sha1": "d7949810ec706e70159f0e09860b6f627197a29d",
"time": "2020-1-16 16:19:04"
},
{
"sha1": "faa51e270e00316a1f7c005e526dde26b7ceaef1",
"time": "2020-1-15 18:02:58"
}
]
Loading

0 comments on commit 5d9dee8

Please sign in to comment.