open method
Open a media file
source: The url or local path of the media file
Implementation
void open(String source) {
_source = source;
if (id.value != null) {
error.value = null;
mediaInfo.value = null;
videoSize.value = Size.zero;
position.value = 0;
bufferRange.value = BufferRange.empty;
finishedTimes.value = 0;
playbackState.value = PlaybackState.closed;
_methodChannel.invokeMethod('open', {
'id': id.value,
'value': source,
});
}
loading.value = true;
}