PreloadWithUrl

Preloads a URL resource.

static bool PreloadWithUrl(const char* url, Error *err = nullptr)  {
    return RtePlayerPreloadWithUrl(nullptr, url, err != nullptr ? err->get_underlying_impl() : nullptr);
Since
v4.5.0

After successful preloading, the speed of accessing URL resources can be accelerated when calling OpenWithUrl. When you need to use these resources, you can access them more quickly and shorten the waiting process.

Applicable scenarios

Before opening media resources, preloading can reduce the time for waiting and provide a smoother user experience.

Call timing

Call this method after OpenWithUrl.

Restrictions

This method currently only takes effect on URLs with the prefix rte://. A maximum of 20 URLs can be preloaded. If exceeded, the newly preloaded URL will replace the oldest one.

Parameters

url
URLs with the rte:// prefix.
err
The state or error information: Error.

Returns

Whether preloading is successful:
  • true: Preloading succeeds.
  • false: Preloading fails.