Added closeVideoStream function to avoid crashes