简体   繁体   中英

Set priorities when loading HTML-page

I use a custom javascript on an HTML pageload to decode a 10 second video, using a proprietary codec, not natively supported by the browsers. My problem is that it stalls the browser completely for about 2-3 seconds while the decoding/loading into memory takes place.

Is it possible to actively reduce the amount of allocated CPU-power for specific purposes, so that the browser allocates (for instance) 30% for specific javascript-files? Or perhaps other suggestions in order to prevent the lock-up?

You probably should have a look at Web Workers .

Web Workers provide a simple means for web content to run scripts in background threads. The worker thread can perform tasks without interfering with the user interface.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM