added code to check network connection before video start buffering