setRestoreData method
void
setRestoreData({
- RestoreDataSourceCallback? restoreDataSource,
- RestoreTimeCallback? resumeTime,
optional
Set the restoreDataSource and resumeTime of video.
For live streaming or DRM-encrypted content playback, you must check whether the
streaming URL has changed or the DRM session or license has expired, and specify
the new URL and DRM information as needed.
- restoreDataSource
nullable
: Optional updated restoreDataSource after suspend, includes elements such as the new URL and DRM information. If null, the dataSource stored at 'initailize()' is used. For live streaming or DRM-encrypted content playback, in case the URL has changed or the DRM license or session has expired, checking for and passing the newest URL is recommended. - resumeTime
default=-1
: (milliseconds) Optional position from which to resume playback in three scenarios: the streaming type is live, power off/on within 5 seconds, or changing the URL(that is, restoreDataSource is non-null). If less than 0, the position stored at '_suspend()' is used.
Implementation
void setRestoreData({
RestoreDataSourceCallback? restoreDataSource,
RestoreTimeCallback? resumeTime,
}) {
_onRestoreDataSource = restoreDataSource;
_onRestoreTime = resumeTime;
}