OpenWithUrl
Opens a URL.
void OpenWithUrl(const char* url, uint64_t start_time, std::function<void(rte::Error* err)> cb);
- Since
- v4.5.0
This method can open a live stream via URL. If you want to speed up the process of opening a URL, you can call the PreloadWithUrl method to preload the URL before calling the method.
If you fail to open the URL, you will receive the onStateChanged callback reporting the state as kRtePlayerStateFailed. At this time, you need to call Stop first, then call OpenWithUrl to reopen the URL. If you have disabled autoplay, you can call Play to play after opening the URL.
Call timing
Call this method after Player.
Restrictions
This method currently only supports playing URLs with the rte:// prefix.
Parameters
- url
- URLs with the
rte://prefix. - start_time
- Reserved for future use.
- cb
- An asynchronous callback, used to notify the result of opening a URL. If an error occurs during the opening, you can get specific error information through the err parameter in this callback. See Error.