openWithUrl

Opens a URL resource.

public void openWithUrl(String url, long startTime, AsyncCallback callback)
Since
Available since v4.4.0.

This method supports opening live streaming resources via URL. To speed up opening, you can preload the resource using preloadWithUrl before calling this method. If opening the resource fails, you will receive the onStateChanged callback with the player state as FAILED. In this case, you need to call stop first, then call openWithUrl again to reopen the resource. If you have disabled autoplay, you can call play after the resource is opened to start playback.

Note: This method currently only supports URLs starting with rte://, CDN streaming URLs, and local media files.

Timing

This method must be called after Player.

Parameters

url
The URL to open. It can be a CDN streaming URL, a local media file, or a URL prefixed with rte://.
startTime
The start position of playback, in milliseconds.
callback
Callback for asynchronously notifying the result of opening the URL resource. You can get error information through the onResult method of this callback.