initialize method

Future<void> initialize(
  1. Map<String, VideoSource> sources, {
  2. bool autoPlay = true,
})

Implementation

Future<void> initialize(
  Map<String, VideoSource> sources, {
  bool autoPlay = true,
}) async {
  WidgetsBinding.instance?.addObserver(this);
  final MapEntry<String, VideoSource> entry = sources.entries.first;
  _mounted = true;
  _source = sources;
  await changeSource(
    name: entry.key,
    source: entry.value,
    autoPlay: autoPlay,
  );
  log("VIDEO VIEWER INITIALIZED");
  Wakelock.enable();
}