setDataSource method
Implementation
Future<void> setDataSource(String dataSource,
{String? package,
bool isLooping = false,
bool autoPlay = true,
bool? mixWithOthers,
Future<ClosedCaptionFile>? closedCaptionFile,
Widget? prepare,
Alignment? alignment,
BoxFit? fit}) async {
if (_isRelease == true) {
BLLogger.error("videoPlayer has been release");
throw FlutterError(
" release() has been performed ,please initialize again ");
}
this.isLooping = isLooping;
this.autoPlay = autoPlay;
this.package = package;
this.alignment = alignment;
this.fit = fit;
this.prepare = prepare;
await _innerReset();
_updatePlayerState(BlVideoPlayerState.prepareInitialized);
_videoPlayerController = _initVideoController(
dataSource, mixWithOthers, package, closedCaptionFile);
_initialize();
BLLogger.info("parameters:\n"
"[package = $package] \n"
"[isLooping = $isLooping] \n"
"[autoPlay = $autoPlay] \n"
"[alignment = $alignment] \n"
"[fit = $fit]");
}