init method
Implementation
Future<void> init(String url, double width, double height, bool isRepeat) async {
if (playInfoStream != null) {
playInfoStream?.cancel();
playInfoStream = null;
}
playInfoStream = Stream.periodic(const Duration(milliseconds: 100), (x) => x)
.listen((event) async {
var duration = await getCurrentPosition();
var total = await getDuration();
var isPlay = await isPlaying();
onPlayInfo?.call(Video360PlayInfo(
duration: duration, total: total, isPlaying: isPlay));
});
await Video360Platform.instance.init(id, url, width, height, isRepeat);
}