Optimization

Hello there,

I have been optimizing my game and ended on this page on the manual:
https://developer.playcanvas.com/en/user-manual/optimization/load-time/

It has one paragraph that says:

  • Use the Networking panel in Chrome Dev Tools (or the equivalent in other browsers) to sort loaded assets by size and look for anything that stands out. Look for assets that are not used and could be deleted. Look for assets that are essentially duplicates and delete them.

I have been looking on the inspector on the Network options and found my videos where downloading twice, as shown on this img:


Rightnow I only have one video, but if I add more it will add up to many Mb…

The video is only used once and it is not load on preload:

Any clue how to solve this or what is going on?
Because with other elements as images or fonts were solved by unchecking the preload.

It seems this asset was imported as an audio, and streaming of audio is not supported.
Ideally you’d host videos on your CDN or similar, and stream play it, instead of adding those as assets. There are some example projects for this I think if you google for it.

2 Likes

Yes, you aren’t doing anything wrong, the same behavior can be observed in the Video Texture example. The browser is downloading chunks (parts) of the video file:

1 Like

Ok, I will take a look on the proposal. Thanks