SwitchWithUrl
Switches to a new URL during playback.
void SwitchWithUrl(const char* url, bool sync_pts, std::function<void(rte::Error* err)> cb)
- Since
- Available since v4.5.1.
Note: This method is only effective when the player has opened a non-
RTE URL. Call this method when the SDK reports the player state as kRtePlayerStateOpenCompleted.Parameters
- url
- The new URL to switch to.
- sync_pts
- Whether to synchronize the playback position:
- true: Synchronize playback position.
- false: (Default) Do not synchronize playback position.
- cb
- Callback that asynchronously notifies the result of the switch operation. You can get the operation result or error code from the
errparameter in the callback. See Error. Possible values oferrinclude:kRteOk: Switch succeeded.kRteErrorDefault: Switch failed.kRteErrorInvalidArgument: Provided URL is empty or invalid format.kRteErrorInvalidOperation:- The corresponding internal Player object has been destroyed or is invalid.
- The currently opened URL is an
RTEURL, which does not support switching.