1) People in and around Mosul, both civies and ISIS, have access to the internet, and have smartphones and are streaming this stuff out.
2) Given the terrain around Mosul, it's kind of hard to miss a major assault about to take place anyways - it's not a surprise to anybody.
3) ISIS has people inside of the Iraqi government/military. Again, not a surprise. Also, ISIS has people in the outlying villages ready to alert them of $#@! headed their way.
4) They are trying to minimize civilian casualties by letting them know where $#@! is going down.
5) They are trying to scare the rank-and-file of ISIS into getting the $#@! out of Dodge.
6) All of the above.