OpenWithUrl
Opens a URL resource.
void OpenWithUrl(const char* url, uint64_t start_time, std::function<void(rte::Error* err)> cb)
- Since
- Available since v4.4.0.
This method supports opening live streaming media resources via URL. To speed up URL opening, you can call PreloadWithUrl before this method to preload the resource. If the resource fails to open, you will receive the onStateChanged callback with the state kRtePlayerStateFailed. In this case, you need to call Stop first, then call OpenWithUrl again to reopen the URL. If you have disabled autoplay, you can call Play after the resource is opened to start playback.
Note: This method currently supports URLs starting with
rte://, CDN streaming URLs, and local media files.Timing
This method must be called after Player is initialized.
Parameters
- url
- The URL to open. It can be a CDN streaming URL, a local media file, or a URL starting with
rte://. - start_time
- The playback start position in milliseconds.
- cb
- Callback that asynchronously notifies the result of opening the URL resource. You can get the operation result or error code from the
errparameter in the callback. See Error.