update method
void
update()
override
This is called automatically and sets needsUpdate
to true
every time a new frame is available.
Implementation
void update(){
if(!_updating && _isPlaying){
_updating = true;
_player?.screenshot(format: null).then((v){//format: null
_updating = false;
if(image != null && v != null){
if(image?.data == null || image?.data?.length != v.length){
print('getyweduwb');
image!.data = Uint8Array.fromList(v);
image!.width = _player?.state.width;
image!.height = _player?.state.height;
}
else{
(image!.data as Uint8Array).set(v);
}
}
needsUpdate = true;
});
}
}